[mutter/wayland] pointer/keyboard: fix setting focus



commit 17462c21e80991cbeb8874006fca5e876578d0d0
Author: Marek Chalupa <mchqwerty gmail com>
Date:   Wed Feb 19 13:56:56 2014 +0100

    pointer/keyboard: fix setting focus
    
    Set focus to NULL after using the variable

 src/wayland/meta-wayland-keyboard.c |    6 +++---
 src/wayland/meta-wayland-pointer.c  |    8 +++-----
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 9b54fcb..5b98c4f 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -507,9 +507,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
 
   if (keyboard->focus_surface != NULL)
     {
-      wl_list_remove (&keyboard->focus_surface_listener.link);
-      keyboard->focus_surface = NULL;
-
       if (keyboard->focus_resource)
         {
           if (keyboard->focus_surface->resource)
@@ -523,6 +520,9 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
           wl_list_remove (&keyboard->focus_resource_listener.link);
           keyboard->focus_resource = NULL;
         }
+
+      wl_list_remove (&keyboard->focus_surface_listener.link);
+      keyboard->focus_surface = NULL;
     }
 
   if (surface != NULL)
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 907003f..2a72fc1 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -328,9 +328,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
 
   if (pointer->focus_surface)
     {
-      wl_list_remove (&pointer->focus_surface_listener.link);
-      pointer->focus_surface = NULL;
-
       if (pointer->focus_resource)
         {
           if (pointer->focus_surface->resource)
@@ -342,10 +339,11 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
             }
 
           wl_list_remove (&pointer->focus_resource_listener.link);
-
-          pointer->focus_surface = NULL;
           pointer->focus_resource = NULL;
         }
+
+      wl_list_remove (&pointer->focus_surface_listener.link);
+      pointer->focus_surface = NULL;
     }
 
   if (surface != NULL)


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