mirror of
https://github.com/labwc/labwc.git
synced 2026-02-10 04:27:47 -05:00
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:
parent
b053c9e375
commit
8bb2e2123f
4 changed files with 35 additions and 14 deletions
|
|
@ -46,12 +46,6 @@ desktop_focus_view(struct view *view, bool raise)
|
|||
return;
|
||||
}
|
||||
|
||||
struct server *server = view->server;
|
||||
if (input_inhibit_blocks_surface(&server->seat, view->surface->resource)
|
||||
|| server->session_lock) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (view->minimized) {
|
||||
/*
|
||||
* Unminimizing will map the view which triggers a call to this
|
||||
|
|
@ -80,7 +74,7 @@ desktop_focus_view(struct view *view, bool raise)
|
|||
* that expect to be able to control focus themselves, but can't
|
||||
* under labwc since it's disallowed at the wlroots level.
|
||||
*/
|
||||
struct seat *seat = &server->seat;
|
||||
struct seat *seat = &view->server->seat;
|
||||
if (view->surface != seat->seat->keyboard_state.focused_surface) {
|
||||
seat_focus_surface(seat, view->surface);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue