Skip to content

Commit

Permalink
Recalculate tiling layout on change of display configuration
Browse files Browse the repository at this point in the history
Previously, changing the resolution, scale, or orientation of a display
left tiling layouts that don't fill the screen and/or extend off of the
screen area, until an action like opening a window makes it recalculate
window positions.

Now this is done immediately when the output configuration changes.

Perhaps we should consider if we want a different animation for things
like rotating a screen, but the current behavior isn't too bad.

For floating layouts, `refresh` already remaps windows that are out of
bounds for the output, so this doesn't change that. Perhaps decreasing
the resolution (or moving to a lower resolution output) should try to
reduce the window size. But the current behavior generally seems okay.
  • Loading branch information
ids1024 authored and Drakulix committed Nov 12, 2024
1 parent 641bb75 commit 91bc1c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ impl BackendData {
self.schedule_render(&output);
}

// Update layout for changes in resolution, scale, orientation
shell.workspaces.recalculate();

loop_handle.insert_idle(|state| state.common.update_xwayland_scale());

Ok(())
Expand Down

0 comments on commit 91bc1c0

Please sign in to comment.