summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-02-11 00:53:08 +0100
committerCarlos Garnacho <carlosg@gnome.org>2017-02-15 23:35:11 +0100
commit6e2722298e81ad02e814ef8a4f2c939a457a32c8 (patch)
tree1164cfaa8380e0d21508d4a95e5ed22594a7fa01
parent917aef50900aaffca261d645d46674a7f897082b (diff)
downloadmutter-6e2722298e81ad02e814ef8a4f2c939a457a32c8.tar.gz
wayland: Keep pointer to cursor sprite on MetaWaylandTabletTool
https://bugzilla.gnome.org/show_bug.cgi?id=778474
-rw-r--r--src/wayland/meta-wayland-tablet-tool.c6
-rw-r--r--src/wayland/meta-wayland-tablet-tool.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index c3df2d971..989e0f50d 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -98,7 +98,7 @@ meta_wayland_tablet_tool_update_cursor_surface (MetaWaylandTabletTool *tool)
cursor = NULL;
}
else if (tool->current_tablet)
- cursor = meta_cursor_sprite_from_theme (META_CURSOR_CROSSHAIR);
+ cursor = tool->default_sprite;
else
cursor = NULL;
@@ -397,6 +397,8 @@ meta_wayland_tablet_tool_new (MetaWaylandTabletSeat *seat,
tool->focus_surface_destroy_listener.notify = tablet_tool_handle_focus_surface_destroy;
tool->cursor_surface_destroy_listener.notify = tablet_tool_handle_cursor_surface_destroy;
+ tool->default_sprite = meta_cursor_sprite_from_theme (META_CURSOR_CROSSHAIR);
+
return tool;
}
@@ -416,6 +418,8 @@ meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool)
wl_list_init (wl_resource_get_link (resource));
}
+ g_object_unref (tool->default_sprite);
+
g_slice_free (MetaWaylandTabletTool, tool);
}
diff --git a/src/wayland/meta-wayland-tablet-tool.h b/src/wayland/meta-wayland-tablet-tool.h
index 89ca2a6e1..2e7227375 100644
--- a/src/wayland/meta-wayland-tablet-tool.h
+++ b/src/wayland/meta-wayland-tablet-tool.h
@@ -43,6 +43,7 @@ struct _MetaWaylandTabletTool
MetaWaylandSurface *cursor_surface;
struct wl_listener cursor_surface_destroy_listener;
MetaCursorRenderer *cursor_renderer;
+ MetaCursorSprite *default_sprite;
MetaWaylandSurface *current;
guint32 pressed_buttons;