[gtk+] wayland: Don't spew warnings for blank cursors



commit db49d12fcf3ea26bac8455a4edc5e71f3d3d44d8
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Apr 12 13:56:49 2017 -0400

    wayland: Don't spew warnings for blank cursors
    
    We were unnecessarily spewing warnings when blank cursors
    were getting a new scale set. Standardize on "none" as the
    name for blank cursors, and avoid the warning.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775217

 gdk/wayland/gdkcursor-wayland.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c
index ab50755..cc20bb1 100644
--- a/gdk/wayland/gdkcursor-wayland.c
+++ b/gdk/wayland/gdkcursor-wayland.c
@@ -308,6 +308,10 @@ _gdk_wayland_cursor_set_scale (GdkCursor *cursor,
 
   wayland_cursor->scale = scale;
 
+  /* Blank cursor case */
+  if (g_strcmp0 (wayland_cursor->name, "none") == 0)
+    return;
+
   _gdk_wayland_cursor_update (display_wayland, wayland_cursor);
 }
 
@@ -345,12 +349,18 @@ _gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay  *display,
                           "cursor-type", GDK_CURSOR_IS_PIXMAP,
                           "display", display,
                           NULL);
-  private->name = g_strdup (name);
-  private->scale = scale;
 
   /* Blank cursor case */
   if (!name || g_str_equal (name, "none") || g_str_equal (name, "blank_cursor"))
-    return GDK_CURSOR (private);
+    {
+      private->name = g_strdup ("none");
+      private->scale = scale;
+
+      return GDK_CURSOR (private);
+    }
+
+  private->name = g_strdup (name);
+  private->scale = scale;
 
   if (!_gdk_wayland_cursor_update (display_wayland, private))
     {


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