From 8665003269d1fbe4efe3c477a71400392930cac9 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 30 Nov 2024 09:18:33 +0300 Subject: layout: Extract ScrollingSpace Leave the Workspace to do the workspace parts, and extract the scrolling parts into a new file. This is a pre-requisite for things like the floating layer (which will live in a workspace alongside the scrolling layer). As part of this huge refactor, I found and fixed at least these issues: - Wrong horizontal popup unconstraining for a smaller window in an always-centered column. - Wrong workspace switch in focus_up_or_right(). --- src/input/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/input') diff --git a/src/input/mod.rs b/src/input/mod.rs index 545c82d7..13ed6d7f 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -581,8 +581,8 @@ impl State { self.open_screenshot_ui(); } Action::ScreenshotWindow => { - let active = self.niri.layout.active_window(); - if let Some((mapped, output)) = active { + let focus = self.niri.layout.focus_with_output(); + if let Some((mapped, output)) = focus { self.backend.with_primary_renderer(|renderer| { if let Err(err) = self.niri.screenshot_window(renderer, output, mapped) { warn!("error taking screenshot: {err:?}"); @@ -990,8 +990,8 @@ impl State { self.niri.layout.move_to_workspace(Some(&window), index); // If we focused the target window. - let new_active_win = self.niri.layout.active_window(); - if new_active_win.map_or(false, |(win, _)| win.window == window) { + let new_focus = self.niri.layout.focus(); + if new_focus.map_or(false, |win| win.window == window) { self.maybe_warp_cursor_to_focus(); } } -- cgit