[Xfce4-commits] <parole:bluesabre/gtk3> Simplify invisible_cursor

Simon Steinbeiss noreply at xfce.org
Sun Aug 11 15:17:27 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to 171af0ced543b2e3d2f79e49d0326b43dfc5a0f8 (commit)
       from 12a2dbc624d29e8fc05bab7335699757395b8541 (commit)

commit 171af0ced543b2e3d2f79e49d0326b43dfc5a0f8
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Mar 25 15:29:58 2013 +0100

    Simplify invisible_cursor

 src/common/parole-common.c |   31 +++++++++----------------------
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/src/common/parole-common.c b/src/common/parole-common.c
index 59c3317..358fc00 100644
--- a/src/common/parole-common.c
+++ b/src/common/parole-common.c
@@ -89,30 +89,17 @@ void parole_window_busy_cursor		(GdkWindow *window)
 
 void parole_window_invisible_cursor		(GdkWindow *window)
 {
-    GdkBitmap *empty_bitmap;
-    GdkCursor *cursor;
-    GdkColor  color;
-
-    char cursor_bits[] = { 0x0 }; 
-    
-    if ( G_UNLIKELY (window == NULL) )
-	return;
-	
-    color.red = color.green = color.blue = 0;
-    color.pixel = 0;
-
-    empty_bitmap = gdk_bitmap_create_from_data (window,
-		   cursor_bits,
-		   1, 1);
+    GdkCursor *cursor = NULL;
 
-    cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
-					 empty_bitmap,
-					 &color,
-					 &color, 0, 0);
+    cursor = gdk_cursor_new (GDK_BLANK_CURSOR);
 
     gdk_window_set_cursor (window, cursor);
 
-    gdk_cursor_unref (cursor);
-
-    g_object_unref (empty_bitmap);
+    if (cursor) {
+#if GTK_CHECK_VERSION(3, 0, 0)
+	g_object_unref (cursor);
+#else
+	gdk_cursor_unref (cursor);
+#endif
+    }
 }


More information about the Xfce4-commits mailing list