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
This commit is contained in:
Jonas Ådahl 2015-07-17 15:29:42 +08:00
parent cd1ce2cb0a
commit 68279e8a08
2 changed files with 3 additions and 8 deletions

View File

@ -374,8 +374,6 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
manager = clutter_device_manager_get_default (); manager = clutter_device_manager_get_default ();
pointer->device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE); pointer->device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
pointer->cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
} }
void void
@ -730,8 +728,7 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
void void
meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer) meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
{ {
if (pointer->cursor_tracker == NULL) MetaCursorTracker *cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
return;
if (pointer->current) if (pointer->current)
{ {
@ -747,15 +744,14 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
else else
cursor_sprite = NULL; cursor_sprite = NULL;
meta_cursor_tracker_set_window_cursor (pointer->cursor_tracker, meta_cursor_tracker_set_window_cursor (cursor_tracker, cursor_sprite);
cursor_sprite);
if (cursor_sprite) if (cursor_sprite)
g_object_unref (cursor_sprite); g_object_unref (cursor_sprite);
} }
else else
{ {
meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker); meta_cursor_tracker_unset_window_cursor (cursor_tracker);
} }
} }

View File

@ -65,7 +65,6 @@ struct _MetaWaylandPointer
guint32 focus_serial; guint32 focus_serial;
guint32 click_serial; guint32 click_serial;
MetaCursorTracker *cursor_tracker;
MetaWaylandSurface *cursor_surface; MetaWaylandSurface *cursor_surface;
struct wl_listener cursor_surface_destroy_listener; struct wl_listener cursor_surface_destroy_listener;
int hotspot_x, hotspot_y; int hotspot_x, hotspot_y;