[mutter] pointer/keyboard: Remove focus_resource_listener



commit f1034d0459ccb71f0e945170498286b0af921151
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Apr 16 14:41:18 2014 -0400

    pointer/keyboard: Remove focus_resource_listener
    
    In order to support multiple pointers for the same client, we're
    going to need to kill it.
    
    This will cause crashes for now, but will be fixed by the next
    commit.

 src/wayland/meta-wayland-keyboard.c |   16 ----------------
 src/wayland/meta-wayland-keyboard.h |    1 -
 src/wayland/meta-wayland-pointer.c  |   16 ----------------
 src/wayland/meta-wayland-pointer.h  |    1 -
 4 files changed, 0 insertions(+), 34 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index dde0e71..cb227a9 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -211,19 +211,6 @@ keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
   MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_surface_listener);
 
   keyboard->focus_surface = NULL;
-
-  if (keyboard->focus_resource)
-    {
-      wl_list_remove (&keyboard->focus_resource_listener.link);
-      keyboard->focus_resource = NULL;
-    }
-}
-
-static void
-keyboard_handle_focus_resource_destroy (struct wl_listener *listener, void *data)
-{
-  MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_resource_listener);
-
   keyboard->focus_resource = NULL;
 }
 
@@ -294,7 +281,6 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
   wl_array_init (&keyboard->keys);
 
   keyboard->focus_surface_listener.notify = keyboard_handle_focus_surface_destroy;
-  keyboard->focus_resource_listener.notify = keyboard_handle_focus_resource_destroy;
 
   keyboard->default_grab.interface = &default_keyboard_grab_interface;
   keyboard->default_grab.keyboard = keyboard;
@@ -444,7 +430,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
           uint32_t serial = wl_display_next_serial (display);
           wl_keyboard_send_leave (keyboard->focus_resource, serial, keyboard->focus_surface->resource);
 
-          wl_list_remove (&keyboard->focus_resource_listener.link);
           keyboard->focus_resource = NULL;
         }
 
@@ -473,7 +458,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
           wl_keyboard_send_enter (keyboard->focus_resource, serial, keyboard->focus_surface->resource,
                                   &keyboard->keys);
 
-          wl_resource_add_destroy_listener (keyboard->focus_resource, &keyboard->focus_resource_listener);
           keyboard->focus_serial = serial;
         }
     }
diff --git a/src/wayland/meta-wayland-keyboard.h b/src/wayland/meta-wayland-keyboard.h
index d2c71ff..f67d02f 100644
--- a/src/wayland/meta-wayland-keyboard.h
+++ b/src/wayland/meta-wayland-keyboard.h
@@ -82,7 +82,6 @@ struct _MetaWaylandKeyboard
   MetaWaylandSurface *focus_surface;
   struct wl_listener focus_surface_listener;
   struct wl_resource *focus_resource;
-  struct wl_listener focus_resource_listener;
   uint32_t focus_serial;
 
   MetaWaylandKeyboardGrab *grab;
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index d80df1d..7ed2255 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -60,19 +60,6 @@ pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
   MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_surface_listener);
 
   pointer->focus_surface = NULL;
-
-  if (pointer->focus_resource)
-    {
-      wl_list_remove (&pointer->focus_resource_listener.link);
-      pointer->focus_resource = NULL;
-    }
-}
-
-static void
-pointer_handle_focus_resource_destroy (struct wl_listener *listener, void *data)
-{
-  MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_resource_listener);
-
   pointer->focus_resource = NULL;
 }
 
@@ -271,7 +258,6 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer)
   wl_list_init (&pointer->resource_list);
 
   pointer->focus_surface_listener.notify = pointer_handle_focus_surface_destroy;
-  pointer->focus_resource_listener.notify = pointer_handle_focus_resource_destroy;
 
   pointer->default_grab.interface = &default_pointer_grab_interface;
   pointer->default_grab.pointer = pointer;
@@ -332,7 +318,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
           uint32_t serial = wl_display_next_serial (display);
           wl_pointer_send_leave (pointer->focus_resource, serial, pointer->focus_surface->resource);
 
-          wl_list_remove (&pointer->focus_resource_listener.link);
           pointer->focus_resource = NULL;
         }
 
@@ -365,7 +350,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
             wl_pointer_send_enter (pointer->focus_resource, serial, pointer->focus_surface->resource, sx, 
sy);
           }
 
-          wl_resource_add_destroy_listener (pointer->focus_resource, &pointer->focus_resource_listener);
           pointer->focus_serial = serial;
         }
     }
diff --git a/src/wayland/meta-wayland-pointer.h b/src/wayland/meta-wayland-pointer.h
index d5e3038..98b536c 100644
--- a/src/wayland/meta-wayland-pointer.h
+++ b/src/wayland/meta-wayland-pointer.h
@@ -49,7 +49,6 @@ struct _MetaWaylandPointer
   MetaWaylandSurface *focus_surface;
   struct wl_listener focus_surface_listener;
   struct wl_resource *focus_resource;
-  struct wl_listener focus_resource_listener;
   guint32 focus_serial;
   guint32 click_serial;
 


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