[mutter/wayland] wayland: Fix setting keyboard/pointer focus for new clients



commit 461f74ef18ed512e0b77bae3896ef6e881e922de
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon Dec 2 22:04:44 2013 +0100

    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 a003ea5..ec769e7 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 9a5680e..6246872 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]