Commit 461f74ef authored by Rui Matos's avatar Rui Matos

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
parent 3f022ca9
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment