From f45df4265d089dc4df22a411161db53e5a06bff7 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 16 Nov 2017 19:26:41 +0100 Subject: [PATCH] backends: Trigger MetaCursorTracker::cursor-changed on texture changes So we allow gnome-shell's magnifier to update fake cursors while it's turned on. https://bugzilla.gnome.org/show_bug.cgi?id=754806 --- src/backends/meta-cursor-tracker.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c index 3cdab8389..f1562a259 100644 --- a/src/backends/meta-cursor-tracker.c +++ b/src/backends/meta-cursor-tracker.c @@ -53,6 +53,13 @@ enum { static guint signals[LAST_SIGNAL]; +static void +cursor_texture_updated (MetaCursorSprite *cursor, + MetaCursorTracker *tracker) +{ + g_signal_emit (tracker, signals[CURSOR_CHANGED], 0); +} + static gboolean update_displayed_cursor (MetaCursorTracker *tracker) { @@ -71,7 +78,12 @@ update_displayed_cursor (MetaCursorTracker *tracker) if (tracker->displayed_cursor == cursor) return FALSE; + g_signal_handlers_disconnect_by_func (tracker->displayed_cursor, + cursor_texture_updated, + tracker); g_set_object (&tracker->displayed_cursor, cursor); + g_signal_connect (tracker->displayed_cursor, "texture-changed", + G_CALLBACK (cursor_texture_updated), tracker); return TRUE; }