From 568994400ba42036734a7a08e3f7229544d5ad3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Wed, 29 Aug 2012 22:12:59 +0200 Subject: [PATCH] shell: Always set focus when restoring focus state MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/shell.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shell.c b/src/shell.c index 45323c2..6ad312b 100644 --- a/src/shell.c +++ b/src/shell.c @@ -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); } } -- 2.7.4