From 863569b70248470f82893020853b5ef379378c76 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 31 Mar 2014 15:04:49 -0400 Subject: [PATCH] cursor-tracker: Split out the code that updates the new cursor --- src/core/meta-cursor-tracker.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/core/meta-cursor-tracker.c b/src/core/meta-cursor-tracker.c index 5c315fca6..cc698fbd0 100644 --- a/src/core/meta-cursor-tracker.c +++ b/src/core/meta-cursor-tracker.c @@ -886,6 +886,20 @@ get_displayed_cursor (MetaCursorTracker *tracker) return tracker->root_cursor; } +static void +update_displayed_cursor (MetaCursorTracker *tracker) +{ + if (meta_is_wayland_compositor ()) + { + if (tracker->displayed_cursor) + cogl_pipeline_set_layer_texture (tracker->pipeline, 0, COGL_TEXTURE (displayed_cursor->texture)); + else + cogl_pipeline_set_layer_texture (tracker->pipeline, 0, NULL); + + update_hw_cursor (tracker); + } +} + static void sync_displayed_cursor (MetaCursorTracker *tracker) { @@ -898,16 +912,7 @@ sync_displayed_cursor (MetaCursorTracker *tracker) if (displayed_cursor) tracker->displayed_cursor = meta_cursor_reference_ref (displayed_cursor); - if (meta_is_wayland_compositor ()) - { - if (displayed_cursor) - cogl_pipeline_set_layer_texture (tracker->pipeline, 0, COGL_TEXTURE (displayed_cursor->texture)); - else - cogl_pipeline_set_layer_texture (tracker->pipeline, 0, NULL); - - update_hw_cursor (tracker); - } - + update_displayed_cursor (tracker); g_signal_emit (tracker, signals[CURSOR_CHANGED], 0); }