Skip to content

Commit

Permalink
feat(cli): add command for new option ToggleFloatOverride
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ds13 committed Oct 10, 2024
1 parent 0e8dc85 commit 30bdaf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions komorebi/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ pub enum SocketMessage {
ToggleMonocle,
ToggleMaximize,
ToggleWindowContainerBehaviour,
ToggleFloatOverride,
WindowHidingBehaviour(HidingBehaviour),
ToggleCrossMonitorMoveBehaviour,
CrossMonitorMoveBehaviour(MoveBehaviour),
Expand Down
3 changes: 3 additions & 0 deletions komorebi/src/process_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,9 @@ impl WindowManager {
}
}
}
SocketMessage::ToggleFloatOverride => {
self.window_management_behaviour.float_override = !self.window_management_behaviour.float_override;
}
SocketMessage::WindowHidingBehaviour(behaviour) => {
let mut hiding_behaviour = HIDING_BEHAVIOUR.lock();
*hiding_behaviour = behaviour;
Expand Down
5 changes: 5 additions & 0 deletions komorebic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,8 @@ enum SubCommand {
WorkspaceName(WorkspaceName),
/// Toggle the behaviour for new windows (stacking or dynamic tiling)
ToggleWindowContainerBehaviour,
/// Enable or disable float override, which makes it so every new window opens in floating mode
ToggleFloatOverride,
/// Toggle window tiling on the focused workspace
TogglePause,
/// Toggle window tiling on the focused workspace
Expand Down Expand Up @@ -2470,6 +2472,9 @@ Stop-Process -Name:komorebi -ErrorAction SilentlyContinue
SubCommand::ToggleWindowContainerBehaviour => {
send_message(&SocketMessage::ToggleWindowContainerBehaviour)?;
}
SubCommand::ToggleFloatOverride => {
send_message(&SocketMessage::ToggleFloatOverride)?;
}
SubCommand::WindowHidingBehaviour(arg) => {
send_message(&SocketMessage::WindowHidingBehaviour(arg.hiding_behaviour))?;
}
Expand Down

0 comments on commit 30bdaf3

Please sign in to comment.