From 477bae14220f4bd10578a3e8ba758a9704443962 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Mon, 16 Feb 2026 20:19:06 +0000 Subject: [PATCH] layer: let top-layer on-demand clients grab focus Soften the new rule introduced by 155c153 because it broke lxqt-runner which defaults to the top-layer, and we do not want to knowingly break user-space without a very good reason which we do not have for this. Fixes: #3381 --- src/layers.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/layers.c b/src/layers.c index 4a2ef653..7feb026d 100644 --- a/src/layers.c +++ b/src/layers.c @@ -383,9 +383,9 @@ handle_unmap(struct wl_listener *listener, void *data) } static bool -is_overlay(struct wlr_layer_surface_v1 *layer_surface) +is_above_toplevels(struct wlr_layer_surface_v1 *layer_surface) { - return layer_surface->current.layer == ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; + return layer_surface->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP; } static void @@ -408,18 +408,18 @@ handle_map(struct wl_listener *listener, void *data) /* * Layer-shell clients with exclusive interactivity always get focus, - * whereas on-demand ones only get it when in the overlay layer. We - * could make this configurable, but for the time being this default - * behaviour strikes a balance between: + * whereas on-demand ones only get it when above toplevels (i.e. in the + * top or overlay layers). We could make this configurable, but for the + * time being this default behaviour strikes a balance between: * - * 1. Giving overlay, on-demand clients (like labnag with the default - * settings) keyboard focus. - * 2. Preventing desktop components like panels and desktops from - * stealing keyboard focus on re-start. On compositor start, this - * is not really a problem, but if any such client restarts later, + * 1. Giving top/overlay, on-demand clients (like labnag and + * lxqt-runner) keyboard focus. + * 2. Preventing desktop components like desktops from stealing + * keyboard focus on re-start. On compositor start, this is not + * really a problem, but if any such client restarts later, * focus-stealing is unlikely to be desirable. */ - if (!is_overlay(layer_surface) && is_on_demand(layer_surface)) { + if (!is_above_toplevels(layer_surface) && is_on_demand(layer_surface)) { return; }