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
This commit is contained in:
Matthias Clasen 2017-04-12 13:56:49 -04:00
parent d2d8fb0528
commit db49d12fcf

View File

@ -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))
{