From 06bf71162ee34b35d46106d28412be69e8d173a0 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sat, 9 Mar 2024 10:48:52 +0000 Subject: [PATCH] cursor: use layer_try_set_focus() on press This means that the logic described in 2ff026b will be used when a layer-surface is pressed on with a cursor button. For example, a surface with on-demand keyboard interactivity will not steal focus from a client with exclusive keyboard interactivity. --- src/input/cursor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/input/cursor.c b/src/input/cursor.c index b1a661c1..ad5782ed 100644 --- a/src/input/cursor.c +++ b/src/input/cursor.c @@ -18,6 +18,7 @@ #include "input/gestures.h" #include "input/touch.h" #include "labwc.h" +#include "layers.h" #include "menu/menu.h" #include "regions.h" #include "resistance.h" @@ -970,14 +971,14 @@ cursor_button_press(struct seat *seat, uint32_t button, struct wlr_layer_surface_v1 *layer = wlr_layer_surface_v1_try_from_wlr_surface(ctx.surface); if (layer && layer->current.keyboard_interactive) { - seat_set_focus_layer(seat, layer); + layer_try_set_focus(seat, layer); } } else if (ctx.type == LAB_SSD_LAYER_SUBSURFACE) { wlr_log(WLR_DEBUG, "press on layer-subsurface"); struct wlr_layer_surface_v1 *layer = subsurface_parent_layer(ctx.surface); if (layer && layer->current.keyboard_interactive) { - seat_set_focus_layer(seat, layer); + layer_try_set_focus(seat, layer); } #ifdef HAVE_XWAYLAND } else if (ctx.type == LAB_SSD_UNMANAGED) {