Skip to content

Commit

Permalink
seat: do not update active_view on layer-shell keyboard focus
Browse files Browse the repository at this point in the history
...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: labwc#1336
  • Loading branch information
johanmalm committed Dec 19, 2023
1 parent 3a959cc commit 6a2a52c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/seat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a2a52c

Please sign in to comment.