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>
This commit is contained in:
Jonas Ådahl 2012-08-29 22:12:59 +02:00 committed by Kristian Høgsberg
parent 9fa9b8b219
commit 568994400b

View File

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