Allow keyboard focus for bottom and background layers
Browse files at this commit152ed59502bb0e7279d896f2ab4eaabfbcc536daParent: 8e16be91 changed file +9 -4
- src/niri.rs +9 -4
src/niri.rsmodified+9 -4
| @@ -928,14 +928,19 @@ impl State { | |||
| 928 | if mon.render_above_top_layer() { | 928 | if mon.render_above_top_layer() { |
| 929 | surface = surface.or_else(layout_focus); | 929 | surface = surface.or_else(layout_focus); |
| 930 | surface = surface.or_else(|| focus_on_layer(Layer::Top)); | 930 | surface = surface.or_else(|| focus_on_layer(Layer::Top)); |
| 931 | + surface = surface.or_else(|| focus_on_layer(Layer::Bottom)); | ||
| 932 | + surface = surface.or_else(|| focus_on_layer(Layer::Background)); | ||
| 931 | } else { | 933 | } else { |
| 932 | surface = surface.or_else(|| focus_on_layer(Layer::Top)); | 934 | surface = surface.or_else(|| focus_on_layer(Layer::Top)); |
| 935 | + surface = surface.or_else(|| on_d_focus_on_layer(Layer::Bottom)); | ||
| 936 | + surface = surface.or_else(|| on_d_focus_on_layer(Layer::Background)); | ||
| 933 | surface = surface.or_else(layout_focus); | 937 | surface = surface.or_else(layout_focus); |
| 934 | - } | ||
| 935 | 938 | ||
| 936 | - // Bottom and background layers can receive on-demand focus only. | 939 | + // Bottom and background layers can only receive exclusive focus when there are no |
| 937 | - surface = surface.or_else(|| on_d_focus_on_layer(Layer::Bottom)); | 940 | + // layout windows. |
| 938 | - surface = surface.or_else(|| on_d_focus_on_layer(Layer::Background)); | 941 | + surface = surface.or_else(|| excl_focus_on_layer(Layer::Bottom)); |
| 942 | + surface = surface.or_else(|| excl_focus_on_layer(Layer::Background)); | ||
| 943 | + } | ||
| 939 | 944 | ||
| 940 | surface.unwrap_or(KeyboardFocus::Layout { surface: None }) | 945 | surface.unwrap_or(KeyboardFocus::Layout { surface: None }) |
| 941 | } else { | 946 | } else { |