diff --git a/komorebi-core/src/lib.rs b/komorebi-core/src/lib.rs index 743d714e..38e6203b 100644 --- a/komorebi-core/src/lib.rs +++ b/komorebi-core/src/lib.rs @@ -283,6 +283,8 @@ pub enum MoveBehaviour { Swap, /// Insert the window container into the focused workspace on the adjacent monitor Insert, + /// Do nothing if trying to move a window container in the direction of an adjacent monitor + NoOp, } #[derive( diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 57d54600..f1b1bdcc 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -1187,6 +1187,7 @@ impl WindowManager { MoveBehaviour::Insert => { self.cross_monitor_move_behaviour = MoveBehaviour::Swap; } + _ => {} } } SocketMessage::CrossMonitorMoveBehaviour(behaviour) => { diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index c5540153..c45293bf 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -1333,6 +1333,11 @@ impl WindowManager { // If there is nowhere to move on the current workspace, try to move it onto the monitor // in that direction if there is one None => { + // Don't do anything if the user has set the MoveBehaviour to NoOp + if matches!(self.cross_monitor_move_behaviour, MoveBehaviour::NoOp) { + return Ok(()); + } + let target_monitor_idx = self .monitor_idx_in_direction(direction) .ok_or_else(|| anyhow!("there is no container or monitor in this direction"))?;