mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-22 17:39:20 +01:00
feat(wm): enforce last known layout on unpause
This commit ensures that the last known layout is restored on a workspace when a command to unpause has been received.
This commit is contained in:
@@ -143,6 +143,7 @@ impl WindowManager {
|
||||
}
|
||||
|
||||
self.is_paused = !self.is_paused;
|
||||
self.retile_all(true)?;
|
||||
}
|
||||
SocketMessage::ToggleTiling => {
|
||||
self.toggle_tiling()?;
|
||||
@@ -161,7 +162,7 @@ impl WindowManager {
|
||||
self.focus_monitor(monitor_idx)?;
|
||||
self.update_focused_workspace(self.mouse_follows_focus)?;
|
||||
}
|
||||
SocketMessage::Retile => self.retile_all()?,
|
||||
SocketMessage::Retile => self.retile_all(false)?,
|
||||
SocketMessage::FlipLayout(layout_flip) => self.flip_layout(layout_flip)?,
|
||||
SocketMessage::ChangeLayout(layout) => self.change_workspace_layout_default(layout)?,
|
||||
SocketMessage::ChangeLayoutCustom(path) => self.change_workspace_custom_layout(path)?,
|
||||
@@ -464,11 +465,11 @@ impl WindowManager {
|
||||
}
|
||||
SocketMessage::InvisibleBorders(rect) => {
|
||||
self.invisible_borders = rect;
|
||||
self.retile_all()?;
|
||||
self.retile_all(false)?;
|
||||
}
|
||||
SocketMessage::WorkAreaOffset(rect) => {
|
||||
self.work_area_offset = Option::from(rect);
|
||||
self.retile_all()?;
|
||||
self.retile_all(false)?;
|
||||
}
|
||||
SocketMessage::QuickSave => {
|
||||
let workspace = self.focused_workspace()?;
|
||||
|
||||
@@ -443,7 +443,7 @@ impl WindowManager {
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub fn retile_all(&mut self) -> Result<()> {
|
||||
pub fn retile_all(&mut self, preserve_resize_dimensions: bool) -> Result<()> {
|
||||
let invisible_borders = self.invisible_borders;
|
||||
let offset = self.work_area_offset;
|
||||
|
||||
@@ -454,8 +454,10 @@ impl WindowManager {
|
||||
.ok_or_else(|| anyhow!("there is no workspace"))?;
|
||||
|
||||
// Reset any resize adjustments if we want to force a retile
|
||||
for resize in workspace.resize_dimensions_mut() {
|
||||
*resize = None;
|
||||
if !preserve_resize_dimensions {
|
||||
for resize in workspace.resize_dimensions_mut() {
|
||||
*resize = None;
|
||||
}
|
||||
}
|
||||
|
||||
workspace.update(&work_area, offset, &invisible_borders)?;
|
||||
|
||||
Reference in New Issue
Block a user