[gnome-shell] shell-util: Fix warning in shell_util_cursor_tracker_to_clutter



commit 751154d9daaa3bd55b355f02af636d4b4322328a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Feb 23 10:52:59 2014 -0500

    shell-util: Fix warning in shell_util_cursor_tracker_to_clutter
    
    If the sprite is NULL, like if a Wayland app wanted to hide the cursor,
    then we need to hide the ClutterTexture on our side, as ClutterTexture
    has no easy way to tell it to paint nothing.

 src/shell-util.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-util.c b/src/shell-util.c
index bbbb86f..61676ec 100644
--- a/src/shell-util.c
+++ b/src/shell-util.c
@@ -347,5 +347,13 @@ shell_util_cursor_tracker_to_clutter (MetaCursorTracker *tracker,
   CoglTexture *sprite;
 
   sprite = meta_cursor_tracker_get_sprite (tracker);
-  clutter_texture_set_cogl_texture (texture, sprite);
+  if (sprite)
+    {
+      clutter_actor_show (CLUTTER_ACTOR (texture));
+      clutter_texture_set_cogl_texture (texture, sprite);
+    }
+  else
+    {
+      clutter_actor_hide (CLUTTER_ACTOR (texture));
+    }
 }


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