gtk3/gtk3-silence-log-spew-blank-cursors.patch

55 lines
1.7 KiB
Diff
Raw Normal View History

From 56714ffa0d61512bc249b481fc43e0bc118f47d7 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Wed, 12 Apr 2017 13:56:49 -0400
Subject: [PATCH] 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 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c
index ab50755873..bffeff8884 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_str_equal (wayland_cursor->name, "none"))
+ 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))
{
--
2.12.2