Skip to content

Commit

Permalink
feat(wm): add retile with resize socket msg
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LGUG2Z committed Oct 13, 2024
1 parent 5da72e1 commit 1376d7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion komorebi-bar/src/komorebi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ impl BarWidget for Komorebi {
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");
}
}
Expand Down
1 change: 1 addition & 0 deletions komorebi/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ pub enum SocketMessage {
Stop,
TogglePause,
Retile,
RetileWithResizeDimensions,
QuickSave,
QuickLoad,
Save(PathBuf),
Expand Down
5 changes: 5 additions & 0 deletions komorebi/src/process_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,11 @@ impl WindowManager {
border_manager::destroy_all_borders()?;
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::ChangeLayout(layout) => self.change_workspace_layout_default(layout)?,
SocketMessage::CycleLayout(direction) => self.cycle_layout(direction)?,
Expand Down

0 comments on commit 1376d7b

Please sign in to comment.