kms: Use scaled sizes for placing new outputs

This commit is contained in:
Victoria Brekenfeld 2025-01-06 19:47:12 +01:00 committed by Victoria Brekenfeld
parent bebd7c5c40
commit 870e5be2a6
4 changed files with 16 additions and 11 deletions

View file

@ -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());
}

View file

@ -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;
}
}
}