]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: use layer_try_set_focus() on press
authorJohan Malm <jgm323@gmail.com>
Sat, 9 Mar 2024 10:48:52 +0000 (10:48 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 17 Mar 2024 21:18:47 +0000 (21:18 +0000)
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

index b1a661c1802307679d870cb0b107ea03121b7665..ad5782ed366802443b96b6a589289f010e97db02 100644 (file)
@@ -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) {