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
This commit is contained in:
Rui Matos 2013-12-02 22:04:44 +01:00
parent 3f022ca963
commit 461f74ef18
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;