From 152ed59502bb0e7279d896f2ab4eaabfbcc536da Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 3 Jan 2025 16:41:27 +0300 Subject: Allow keyboard focus for bottom and background layers --- src/niri.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/niri.rs b/src/niri.rs index c8180c73..69b60dbe 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -928,14 +928,19 @@ impl State { if mon.render_above_top_layer() { surface = surface.or_else(layout_focus); surface = surface.or_else(|| focus_on_layer(Layer::Top)); + surface = surface.or_else(|| focus_on_layer(Layer::Bottom)); + surface = surface.or_else(|| focus_on_layer(Layer::Background)); } else { surface = surface.or_else(|| focus_on_layer(Layer::Top)); + surface = surface.or_else(|| on_d_focus_on_layer(Layer::Bottom)); + surface = surface.or_else(|| on_d_focus_on_layer(Layer::Background)); surface = surface.or_else(layout_focus); - } - // Bottom and background layers can receive on-demand focus only. - surface = surface.or_else(|| on_d_focus_on_layer(Layer::Bottom)); - surface = surface.or_else(|| on_d_focus_on_layer(Layer::Background)); + // Bottom and background layers can only receive exclusive focus when there are no + // layout windows. + surface = surface.or_else(|| excl_focus_on_layer(Layer::Bottom)); + surface = surface.or_else(|| excl_focus_on_layer(Layer::Background)); + } surface.unwrap_or(KeyboardFocus::Layout { surface: None }) } else { -- cgit