kms: Use scaled sizes for placing new outputs
This commit is contained in:
parent
bebd7c5c40
commit
870e5be2a6
4 changed files with 16 additions and 11 deletions
|
|
@ -277,7 +277,7 @@ impl State {
|
|||
) {
|
||||
Ok((output, should_expose)) => {
|
||||
if should_expose {
|
||||
w += output.config().transformed_size().w as u32;
|
||||
w += output.geometry().size.w as u32;
|
||||
wl_outputs.push(output.clone());
|
||||
}
|
||||
device.outputs.insert(conn, output);
|
||||
|
|
@ -345,13 +345,7 @@ impl State {
|
|||
.find_map(|(crtc, surface)| (surface.connector == conn).then_some(crtc))
|
||||
.cloned()
|
||||
{
|
||||
let surface = device.surfaces.remove(&crtc).unwrap();
|
||||
if surface.output.mirroring().is_none() {
|
||||
// TODO: move up later outputs?
|
||||
w = w.saturating_sub(
|
||||
surface.output.config().transformed_size().w as u32,
|
||||
);
|
||||
}
|
||||
device.surfaces.remove(&crtc).unwrap();
|
||||
}
|
||||
|
||||
if !changes.added.iter().any(|(c, _)| c == &conn) {
|
||||
|
|
@ -376,7 +370,7 @@ impl State {
|
|||
) {
|
||||
Ok((output, should_expose)) => {
|
||||
if should_expose {
|
||||
w += output.config().transformed_size().w as u32;
|
||||
w += output.geometry().size.w as u32;
|
||||
outputs_added.push(output.clone());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ impl KmsState {
|
|||
startup_done.clone(),
|
||||
)?;
|
||||
if output.mirroring().is_none() {
|
||||
w += output.config().transformed_size().w as u32;
|
||||
w += output.geometry().size.w as u32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
use crate::{
|
||||
shell::Shell,
|
||||
state::{BackendData, State},
|
||||
utils::prelude::OutputExt,
|
||||
wayland::protocols::{
|
||||
output_configuration::OutputConfigurationState, workspace::WorkspaceUpdateGuard,
|
||||
},
|
||||
|
|
@ -476,6 +477,16 @@ impl Config {
|
|||
output_state.update();
|
||||
self.write_outputs(output_state.outputs());
|
||||
} else {
|
||||
// we don't have a config, so lets generate somewhat sane positions
|
||||
let mut w = 0;
|
||||
for output in outputs.iter().filter(|o| o.mirroring().is_none()) {
|
||||
{
|
||||
let mut config = output.config_mut();
|
||||
config.position = (w, 0);
|
||||
}
|
||||
w += output.geometry().size.w as u32;
|
||||
}
|
||||
|
||||
if let Err(err) = backend.apply_config_for_outputs(
|
||||
false,
|
||||
loop_handle,
|
||||
|
|
|
|||
|
|
@ -3617,7 +3617,7 @@ impl Shell {
|
|||
.unwrap()
|
||||
.take()
|
||||
.unwrap_or(ManagedLayer::Floating);
|
||||
|
||||
|
||||
match previous_layer {
|
||||
ManagedLayer::Tiling if workspace.tiling_enabled => {
|
||||
let focus_stack = workspace.focus_stack.get(seat);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue