}
static void
+unfocus_all_seats(struct desktop_shell *shell)
+{
+ struct weston_seat *seat, *next;
+
+ wl_list_for_each_safe(seat, next, &shell->compositor->seat_list, link) {
+ if (seat->keyboard == NULL)
+ continue;
+
+ weston_keyboard_set_focus(seat->keyboard, NULL);
+ }
+}
+
+static void
lock(struct desktop_shell *shell)
{
struct workspace *ws = get_current_workspace(shell);
launch_screensaver(shell);
+ /* Remove the keyboard focus on all seats. This will be
+ * restored to the workspace's saved state via
+ * restore_focus_state when the compositor is unlocked */
+ unfocus_all_seats(shell);
+
/* TODO: disable bindings that should not work while locked. */
/* All this must be undone in resume_desktop(). */