From 30bdaf33d5d2ce80b6f6e9a98aec745654c8159b Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:30:37 +0100 Subject: [PATCH] feat(cli): add command for new option `ToggleFloatOverride` --- komorebi/src/core/mod.rs | 1 + komorebi/src/process_command.rs | 3 +++ komorebic/src/main.rs | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/komorebi/src/core/mod.rs b/komorebi/src/core/mod.rs index 441277fbd..2b8fb68ea 100644 --- a/komorebi/src/core/mod.rs +++ b/komorebi/src/core/mod.rs @@ -77,6 +77,7 @@ pub enum SocketMessage { ToggleMonocle, ToggleMaximize, ToggleWindowContainerBehaviour, + ToggleFloatOverride, WindowHidingBehaviour(HidingBehaviour), ToggleCrossMonitorMoveBehaviour, CrossMonitorMoveBehaviour(MoveBehaviour), diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 1afe965ba..21dbd83dd 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -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; diff --git a/komorebic/src/main.rs b/komorebic/src/main.rs index 0079f43fc..ca94b46f2 100644 --- a/komorebic/src/main.rs +++ b/komorebic/src/main.rs @@ -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 @@ -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))?; }