]> git.mdlowis.com Git - proto/labwc.git/commitdiff
seat: do not update active_view on layer-shell keyboard focus
authorJohan Malm <jgm323@gmail.com>
Tue, 19 Dec 2023 17:45:43 +0000 (17:45 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 19 Dec 2023 20:34:07 +0000 (20:34 +0000)
...because layer-shell clients are not views and we want to be able to
use foreign-toplevel protocol on the active view even if a client such as
a panel has taken keyboard focus.

Written-by: @Consolatis
Fixes: #1336
src/seat.c

index 36aa31511ed071596c9ed4055a0bc45d2dece454..64447df43ab122d61d8da5184b4704f25fc71894 100644 (file)
@@ -349,8 +349,13 @@ focus_change_notify(struct wl_listener *listener, void *data)
        struct seat *seat = wl_container_of(listener, seat, focus_change);
        struct wlr_seat_keyboard_focus_change_event *event = data;
        struct server *server = seat->server;
-       struct view *view = event->new_surface ?
-               view_from_wlr_surface(event->new_surface) : NULL;
+       struct wlr_surface *surface = event->new_surface;
+       struct view *view = surface ? view_from_wlr_surface(surface) : NULL;
+
+       /* Prevent focus switch to layershell client from updating view state */
+       if (surface && wlr_layer_surface_v1_try_from_wlr_surface(surface)) {
+               return;
+       }
 
        /*
         * If an xwayland-unmanaged surface was focused belonging to the