diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-06 18:20:19 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-06 18:20:19 +0400 |
| commit | e394a7ff2006985b27903bdf694573543f0f6268 (patch) | |
| tree | be8c2bf4e707cb8a93d4935fe58788ae77ce199c /src/handlers | |
| parent | 921ed632041e3f6e3e3a6be26fcafd301c845004 (diff) | |
| download | niri-e394a7ff2006985b27903bdf694573543f0f6268.tar.gz niri-e394a7ff2006985b27903bdf694573543f0f6268.tar.bz2 niri-e394a7ff2006985b27903bdf694573543f0f6268.zip | |
Implement on-demand layer-shell keyboard focus
Diffstat (limited to 'src/handlers')
| -rw-r--r-- | src/handlers/mod.rs | 2 | ||||
| -rw-r--r-- | src/handlers/xdg_shell.rs | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 5c502a1f..ce2896b2 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -372,6 +372,7 @@ impl ForeignToplevelHandler for State { if let Some((mapped, _)) = self.niri.layout.find_window_and_output(&wl_surface) { let window = mapped.window.clone(); self.niri.layout.activate_window(&window); + self.niri.layer_shell_on_demand_focus = None; self.niri.queue_redraw_all(); } } @@ -540,6 +541,7 @@ impl XdgActivationHandler for State { if let Some((mapped, _)) = self.niri.layout.find_window_and_output(&surface) { let window = mapped.window.clone(); self.niri.layout.activate_window(&window); + self.niri.layer_shell_on_demand_focus = None; self.niri.queue_redraw_all(); } } diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index f3337786..73eb01e9 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -110,11 +110,13 @@ impl XdgShellHandler for State { if intersection.intersects(ResizeEdge::LEFT_RIGHT) { // FIXME: don't activate once we can pass specific windows to actions. self.niri.layout.activate_window(&window); + self.niri.layer_shell_on_demand_focus = None; self.niri.layout.toggle_full_width(); } if intersection.intersects(ResizeEdge::TOP_BOTTOM) { // FIXME: don't activate once we can pass specific windows to actions. self.niri.layout.activate_window(&window); + self.niri.layer_shell_on_demand_focus = None; self.niri.layout.reset_window_height(); } // FIXME: granular. @@ -184,10 +186,13 @@ impl XdgShellHandler for State { let _ = PopupManager::dismiss_popup(&root, &popup); return; } + + // FIXME: popup grabs for on-demand bottom and background layers. } else { if layers.layers_on(Layer::Overlay).any(|l| { l.cached_state().keyboard_interactivity == wlr_layer::KeyboardInteractivity::Exclusive + || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref() }) { let _ = PopupManager::dismiss_popup(&root, &popup); return; @@ -198,6 +203,7 @@ impl XdgShellHandler for State { && layers.layers_on(Layer::Top).any(|l| { l.cached_state().keyboard_interactivity == wlr_layer::KeyboardInteractivity::Exclusive + || Some(l) == self.niri.layer_shell_on_demand_focus.as_ref() }) { let _ = PopupManager::dismiss_popup(&root, &popup); |
