diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 71dc0f92..d999a99d 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -282,15 +282,37 @@ impl WindowManager { self.move_container_in_cycle_direction(direction)?; } - SocketMessage::StackWindow(direction) => self.add_window_to_container(direction)?, - SocketMessage::UnstackWindow => self.remove_window_from_container()?, - SocketMessage::StackAll => self.stack_all()?, - SocketMessage::UnstackAll => self.unstack_all(true)?, + SocketMessage::StackWindow(direction) => { + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); + self.add_window_to_container(direction)?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); + } + SocketMessage::UnstackWindow => { + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); + self.remove_window_from_container()?; + border_manager::destroy_all_borders()?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); + } + SocketMessage::StackAll => { + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); + self.stack_all()?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); + } + SocketMessage::UnstackAll => { + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); + self.unstack_all(true)?; + border_manager::destroy_all_borders()?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); + } SocketMessage::CycleStack(direction) => { + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); self.cycle_container_window_in_direction(direction)?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); } SocketMessage::CycleStackIndex(direction) => { + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); self.cycle_container_window_index_in_direction(direction)?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); } SocketMessage::FocusStackWindow(idx) => { // In case you are using this command on a bar on a monitor @@ -300,7 +322,9 @@ impl WindowManager { if let Some(monitor_idx) = self.monitor_idx_from_current_pos() { self.focus_monitor(monitor_idx)?; } + let restore = ANIMATION_ENABLED_GLOBAL.swap(false, Ordering::SeqCst); self.focus_container_window(idx)?; + ANIMATION_ENABLED_GLOBAL.store(restore, Ordering::SeqCst); } SocketMessage::Minimize => { let foreground_window =