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 <[email protected]>
---
 src/shell.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index 4d6bc4f..b37ea25 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);
        }
 }
 
-- 
1.7.9.5

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to