From 1b2d54d97a11372fbf1b67bc87d9e690cdbd3002 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 May 2022 12:50:47 +0530 Subject: [PATCH] Output a warning when libwayland-cursor returns incorrectly sized cursor images --- glfw/wl_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 565148b3a..5abaf2daf 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -143,6 +143,10 @@ static void setCursor(GLFWCursorShape shape, _GLFWwindow* window) if (!image) return; + if (image->width % scale || image->height % scale) { + _glfwInputError(GLFW_PLATFORM_ERROR, "WARNING: Cursor image size: %dx%d is not a multiple of window scale: %d. This will" + " cause some compositors such as GNOME to crash. See https://github.com/kovidgoyal/kitty/issues/4878", image->width, image->height, scale); + } buffer = wl_cursor_image_get_buffer(image); if (!buffer)