mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-20 15:41:38 +01:00
fix(animation): disable on stacking operations
This commit disables animations on stacking operations because it's just too much of a headache. Additionally, the borders get screwed up sometimes on unstacking, so we'll just go nuclear and destroy and recreate them on an unstack or unstack-all op.
This commit is contained in:
1 parent
64ee9b6e0d
commit
8e6aa34bbf
1 file changed
+28
-4
@@ -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 =
|
||||
|
||||
Reference in new issue
Block a user