seat: move session-lock check down to seat_focus() level

We were checking for a locked session in desktop_focus_view(), but there
are several other call sites of seat_focus_surface() which were missing
such a check. Any one of those could cause the lock screen to lose focus
(making the session impossible to unlock) or another surface to gain it
(breaching the session lock).

To fix the issue, make any call to seat_focus_surface() no-op when the
session is locked. Add a specific seat_focus_lock_surface() function
which is the only way to bypass the check and is called only from
session-lock.c.
This commit is contained in:
John Lindgren 2023-10-15 02:59:58 -04:00 committed by Johan Malm
parent b053c9e375
commit 8bb2e2123f
4 changed files with 35 additions and 14 deletions

View file

@ -432,6 +432,13 @@ void seat_init(struct server *server);
void seat_finish(struct server *server);
void seat_reconfigure(struct server *server);
void seat_focus_surface(struct seat *seat, struct wlr_surface *surface);
/**
* seat_focus_lock_surface() - ONLY to be called from session-lock.c to
* focus lock screen surfaces. Use seat_focus_surface() otherwise.
*/
void seat_focus_lock_surface(struct seat *seat, struct wlr_surface *surface);
void seat_set_focus_layer(struct seat *seat, struct wlr_layer_surface_v1 *layer);
void seat_set_pressed(struct seat *seat, struct view *view,
struct wlr_scene_node *node, struct wlr_surface *surface,