shell: Always set focus when restoring focus state

To avoid having a surface on a hidden workspace in focus always set the
focus (even to NULL) when restoring.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
dev
Jonas Ådahl 12 years ago committed by Kristian Høgsberg
parent 9fa9b8b219
commit 568994400b
  1. 8
      src/shell.c

@ -439,11 +439,13 @@ static void
restore_focus_state(struct desktop_shell *shell, struct workspace *ws) restore_focus_state(struct desktop_shell *shell, struct workspace *ws)
{ {
struct focus_state *state, *next; struct focus_state *state, *next;
struct wl_surface *surface;
wl_list_for_each_safe(state, next, &ws->focus_list, link) { wl_list_for_each_safe(state, next, &ws->focus_list, link) {
if (state->keyboard_focus) surface = state->keyboard_focus ?
wl_keyboard_set_focus(state->seat->seat.keyboard, &state->keyboard_focus->surface : NULL;
&state->keyboard_focus->surface);
wl_keyboard_set_focus(state->seat->seat.keyboard, surface);
} }
} }

Loading…
Cancel
Save