[Xfce4-commits] [apps/xfce4-screensaver] 190/425: Simplify cursur hiding

noreply at xfce.org noreply at xfce.org
Mon Oct 15 01:50:37 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit c7fee045db811e12a76894cddbf5604af7d57941
Author: infirit <infirit at gmail.com>
Date:   Thu Jul 9 13:27:15 2015 +0200

    Simplify cursur hiding
    
    Use GDK_BLANK_CURSOR across Gtk versions for new cursors.
---
 src/gs-grab-x11.c   | 31 -------------------------------
 src/gs-window-x11.c | 23 +----------------------
 2 files changed, 1 insertion(+), 53 deletions(-)

diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c
index 72809d5..83b04e0 100644
--- a/src/gs-grab-x11.c
+++ b/src/gs-grab-x11.c
@@ -58,33 +58,6 @@ struct GSGrabPrivate
 	GtkWidget *invisible;
 };
 
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static GdkCursor *
-get_cursor (void)
-{
-	GdkBitmap *empty_bitmap;
-	GdkCursor *cursor;
-	GdkColor   useless;
-	char       invisible_cursor_bits [] = { 0x0 };
-
-	useless.red = useless.green = useless.blue = 0;
-	useless.pixel = 0;
-
-	empty_bitmap = gdk_bitmap_create_from_data (NULL,
-	               invisible_cursor_bits,
-	               1, 1);
-
-	cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
-	                                     empty_bitmap,
-	                                     &useless,
-	                                     &useless, 0, 0);
-
-	g_object_unref (empty_bitmap);
-
-	return cursor;
-}
-#endif
-
 static const char *
 grab_string (int status)
 {
@@ -218,11 +191,7 @@ gs_grab_get_mouse (GSGrab    *grab,
 	g_return_val_if_fail (window != NULL, FALSE);
 	g_return_val_if_fail (screen != NULL, FALSE);
 
-#if GTK_CHECK_VERSION (3, 0, 0)
 	cursor = gdk_cursor_new (GDK_BLANK_CURSOR);
-#else
-	cursor = get_cursor ();
-#endif
 
 	gs_debug ("Grabbing mouse widget=%X", (guint32) GDK_WINDOW_XID (window));
 	status = gdk_pointer_grab (window, TRUE, 0, NULL,
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 458db44..254a9b5 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -155,32 +155,11 @@ set_invisible_cursor (GdkWindow *window,
                       gboolean   invisible)
 {
 	GdkCursor *cursor = NULL;
-#if !GTK_CHECK_VERSION (3, 0, 0)
-	GdkBitmap *empty_bitmap;
-	GdkColor   useless;
-	char       invisible_cursor_bits [] = { 0x0 };
-#endif
 
-#if GTK_CHECK_VERSION (3, 0, 0)
-	cursor = gdk_cursor_new (GDK_BLANK_CURSOR);
-#else
 	if (invisible)
 	{
-		useless.red = useless.green = useless.blue = 0;
-		useless.pixel = 0;
-
-		empty_bitmap = gdk_bitmap_create_from_data (window,
-		               invisible_cursor_bits,
-		               1, 1);
-
-		cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
-		                                     empty_bitmap,
-		                                     &useless,
-		                                     &useless, 0, 0);
-
-		g_object_unref (empty_bitmap);
+		cursor = gdk_cursor_new (GDK_BLANK_CURSOR);
 	}
-#endif
 
 	gdk_window_set_cursor (window, cursor);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list