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

@ -29,7 +29,7 @@ static void
focus_surface(struct session_lock *lock, struct wlr_surface *focused)
{
lock->focused = focused;
seat_focus_surface(&g_server->seat, focused);
seat_focus_lock_surface(&g_server->seat, focused);
}
static void