diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c index c3e97286e1..0cb21093ff 100644 --- a/gdk/wayland/gdkcursor-wayland.c +++ b/gdk/wayland/gdkcursor-wayland.c @@ -224,6 +224,7 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor, { struct wl_cursor_image *image; int cursor_scale; + gboolean warned = FALSE; if (image_index >= wayland_cursor->wl_cursor->image_count) { @@ -236,13 +237,17 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor, image = wayland_cursor->wl_cursor->images[image_index]; cursor_scale = wayland_cursor->scale; - if ((image->width % cursor_scale != 0) || - (image->height % cursor_scale != 0)) + while ((image->width % cursor_scale != 0) || + (image->height % cursor_scale != 0)) { - g_warning (G_STRLOC " cursor image size (%dx%d) not an integer" - "multiple of scale (%d)", image->width, image->height, - cursor_scale); - cursor_scale = 1; + if (!warned) + { + g_warning (G_STRLOC " cursor image size (%dx%d) not an integer" + "multiple of scale (%d)", image->width, image->height, + cursor_scale); + warned = TRUE; + } + cursor_scale--; } *hotspot_x = image->hotspot_x / cursor_scale;