From 461f74ef18ed512e0b77bae3896ef6e881e922de Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Mon, 2 Dec 2013 22:04:44 +0100 Subject: [PATCH] wayland: Fix setting keyboard/pointer focus for new clients When we have a new client, we potentially set the focus on one of its surfaces when we map it but the client might not have called wl_seat.get_keyboard/pointer yet. When it finally calls get_keyboard/pointer we must then register its resource as the focus_resource which means that we can only return early if focus_resource is already set. https://bugzilla.gnome.org/show_bug.cgi?id=719725 --- src/wayland/meta-wayland-keyboard.c | 2 +- src/wayland/meta-wayland-pointer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index a003ea531..ec769e7f4 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -501,7 +501,7 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard, struct wl_resource *resource; uint32_t serial; - if (keyboard->focus == surface) + if (keyboard->focus == surface && keyboard->focus_resource != NULL) return; resource = keyboard->focus_resource; diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 9a5680e74..62468727e 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -303,7 +303,7 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer, struct wl_resource *resource, *kr; uint32_t serial; - if (pointer->focus == surface) + if (pointer->focus == surface && pointer->focus_resource != NULL) return; resource = pointer->focus_resource;