tony / oxwm

Add scrolling layout animations Browse files
tonybtw committed 2026-01-11 parent 1ee9ed1 commit 00a27e6f4de787a15e7b5b22ff11a5ec737c8b84
Showing 1 changed file with 7 additions and 2 deletions. UnifiedSplit
+7 −2 src/window_manager.rs
@@ -867,7 +867,9 @@ impl WindowManager {
867 867
868 let tiled_count = tiled_windows.len(); 868 let tiled_count = tiled_windows.len();
869 if tiled_count <= visible_count { 869 if tiled_count <= visible_count {
870 - if let Some(m) = self.monitors.get_mut(monitor_index) { 870 + if animate && monitor.scroll_offset != 0 {
871 + self.scroll_animation.start(monitor.scroll_offset, 0, &self.animation_config);
872 + } else if let Some(m) = self.monitors.get_mut(monitor_index) {
871 m.scroll_offset = 0; 873 m.scroll_offset = 0;
872 } 874 }
873 return Ok(()); 875 return Ok(());
@@ -2313,7 +2315,7 @@ impl WindowManager {
2313 } 2315 }
2314 2316
2315 if self.layout.name() == "scrolling" { 2317 if self.layout.name() == "scrolling" {
2316 - self.scroll_to_window(window, false)?; 2318 + self.scroll_to_window(window, true)?;
2317 } 2319 }
2318 2320
2319 self.apply_layout()?; 2321 self.apply_layout()?;
@@ -4721,6 +4723,9 @@ impl WindowManager {
4721 let visible = self.visible_windows_on_monitor(self.selected_monitor); 4723 let visible = self.visible_windows_on_monitor(self.selected_monitor);
4722 if let Some(&new_win) = visible.last() { 4724 if let Some(&new_win) = visible.last() {
4723 self.focus(Some(new_win))?; 4725 self.focus(Some(new_win))?;
4726 + if self.layout.name() == "scrolling" {
4727 + self.scroll_to_window(new_win, true)?;
4728 + }
4724 } else if let Some(monitor) = self.monitors.get_mut(self.selected_monitor) { 4729 } else if let Some(monitor) = self.monitors.get_mut(self.selected_monitor) {
4725 monitor.selected_client = None; 4730 monitor.selected_client = None;
4726 } 4731 }