This commit is contained in:
Kovid Goyal 2024-12-20 08:58:35 +05:30
parent 8facaf4fa0
commit af9e9fbc6f
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 3 deletions

View file

@ -702,7 +702,7 @@ set_cursor(GLFWCursorShape shape, _GLFWwindow* window)
struct wl_cursor_theme *theme = glfw_wlc_theme_for_scale(scale);
if (!theme) return;
cursor = _glfwLoadCursor(shape, theme);
if (!cursor) return;
if (!cursor || !cursor->images) return;
image = cursor->images[0];
if (!image) return;
if (image->width % scale || image->height % scale) {

3
glfw/wl_window.c vendored
View file

@ -251,8 +251,7 @@ setCursorImage(_GLFWwindow* window, bool on_theme_change) {
_glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: late cursor load failed; proceeding with existing cursor");
}
}
if (!cursorWayland->cursor || !cursorWayland->cursor->image_count)
return;
if (!cursorWayland->cursor || !cursorWayland->cursor->image_count || !cursorWayland->cursor->images) return;
if (cursorWayland->currentImage >= cursorWayland->cursor->image_count) cursorWayland->currentImage = 0;
image = cursorWayland->cursor->images[cursorWayland->currentImage];
if (!image) image = cursorWayland->cursor->images[0];