[mutter] MetaWaylandPointer: Don't keep our own MetaCursorTracker pointer



commit 68279e8a089a774b0114ec51a8aa7fb69947a027
Author: Jonas Ådahl <jadahl gmail com>
Date:   Fri Jul 17 15:29:42 2015 +0800

    MetaWaylandPointer: Don't keep our own MetaCursorTracker pointer
    
    There is no reason to, we can just retrieve it every time we need it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744932

 src/wayland/meta-wayland-pointer.c |   10 +++-------
 src/wayland/meta-wayland-pointer.h |    1 -
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 0f70b23..385a298 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -374,8 +374,6 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
 
   manager = clutter_device_manager_get_default ();
   pointer->device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
-
-  pointer->cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
 }
 
 void
@@ -730,8 +728,7 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
 void
 meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
 {
-  if (pointer->cursor_tracker == NULL)
-    return;
+  MetaCursorTracker *cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
 
   if (pointer->current)
     {
@@ -747,15 +744,14 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
       else
         cursor_sprite = NULL;
 
-      meta_cursor_tracker_set_window_cursor (pointer->cursor_tracker,
-                                             cursor_sprite);
+      meta_cursor_tracker_set_window_cursor (cursor_tracker, cursor_sprite);
 
       if (cursor_sprite)
         g_object_unref (cursor_sprite);
     }
   else
     {
-      meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
+      meta_cursor_tracker_unset_window_cursor (cursor_tracker);
     }
 }
 
diff --git a/src/wayland/meta-wayland-pointer.h b/src/wayland/meta-wayland-pointer.h
index 8dfbf62..8d0cb10 100644
--- a/src/wayland/meta-wayland-pointer.h
+++ b/src/wayland/meta-wayland-pointer.h
@@ -65,7 +65,6 @@ struct _MetaWaylandPointer
   guint32 focus_serial;
   guint32 click_serial;
 
-  MetaCursorTracker *cursor_tracker;
   MetaWaylandSurface *cursor_surface;
   struct wl_listener cursor_surface_destroy_listener;
   int hotspot_x, hotspot_y;


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