aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-11-30 09:18:33 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-01 22:24:21 -0800
commit8665003269d1fbe4efe3c477a71400392930cac9 (patch)
treec8c7bc727032c51259e4bdbd6e1541c859cc6e0f /src/input
parent1e76716819ecda33dca0e612d62a8f6c2892890d (diff)
downloadniri-8665003269d1fbe4efe3c477a71400392930cac9.tar.gz
niri-8665003269d1fbe4efe3c477a71400392930cac9.tar.bz2
niri-8665003269d1fbe4efe3c477a71400392930cac9.zip
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().
Diffstat (limited to 'src/input')
-rw-r--r--src/input/mod.rs8
1 files changed, 4 insertions, 4 deletions
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();
}
}