feat(wm): add retile with resize socket msg

This commit adds a new SocketMessage variant,
RetileWithResizeDimensions, to preserve any resize dimensions applied by
the user.

This new variant is now used when clicking on a workspace using the
komorebi widget in komorebi-bar.
This commit is contained in:
LGUG2Z
2024-10-13 10:04:09 -07:00
parent 5da72e10df
commit 1376d7be04
3 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -164,7 +164,10 @@ impl BarWidget for Komorebi {
proceed = false; proceed = false;
} }
if proceed && komorebi_client::send_message(&SocketMessage::Retile).is_err() { if proceed
&& komorebi_client::send_message(&SocketMessage::RetileWithResizeDimensions)
.is_err()
{
tracing::error!("could not send message to komorebi: Retile"); tracing::error!("could not send message to komorebi: Retile");
} }
} }
+1
View File
@@ -103,6 +103,7 @@ pub enum SocketMessage {
Stop, Stop,
TogglePause, TogglePause,
Retile, Retile,
RetileWithResizeDimensions,
QuickSave, QuickSave,
QuickLoad, QuickLoad,
Save(PathBuf), Save(PathBuf),
+5
View File
@@ -632,6 +632,11 @@ impl WindowManager {
border_manager::destroy_all_borders()?; border_manager::destroy_all_borders()?;
self.retile_all(false)? self.retile_all(false)?
} }
SocketMessage::RetileWithResizeDimensions => {
border_manager::BORDER_TEMPORARILY_DISABLED.store(false, Ordering::SeqCst);
border_manager::destroy_all_borders()?;
self.retile_all(true)?
}
SocketMessage::FlipLayout(layout_flip) => self.flip_layout(layout_flip)?, SocketMessage::FlipLayout(layout_flip) => self.flip_layout(layout_flip)?,
SocketMessage::ChangeLayout(layout) => self.change_workspace_layout_default(layout)?, SocketMessage::ChangeLayout(layout) => self.change_workspace_layout_default(layout)?,
SocketMessage::CycleLayout(direction) => self.cycle_layout(direction)?, SocketMessage::CycleLayout(direction) => self.cycle_layout(direction)?,