Fixed an instance of eager cursor loading.

Also fixed a minor formatting issue.
This commit is contained in:
TheDaemoness 2020-05-30 10:07:49 -07:00 committed by Kovid Goyal
parent 7c3c87abf6
commit 199ee20adb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 12 deletions

2
glfw/wl_cursors.c vendored
View File

@ -37,7 +37,7 @@ _themeInit(_themeData *dest, const char *name, int px) {
dest->theme = wl_cursor_theme_load(name, px, _glfw.wl.shm); dest->theme = wl_cursor_theme_load(name, px, _glfw.wl.shm);
if(!dest->theme) { if(!dest->theme) {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Unable to load cursor theme"); "Wayland: Unable to load cursor theme");
} }
} else { } else {
dest->theme = NULL; dest->theme = NULL;

13
glfw/wl_window.c vendored
View File

@ -1474,8 +1474,6 @@ static bool isPointerLocked(_GLFWwindow* window)
void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
{ {
struct wl_cursor* defaultCursor;
if (!_glfw.wl.pointer) if (!_glfw.wl.pointer)
return; return;
@ -1496,15 +1494,8 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
setCursorImage(window, &cursor->wl); setCursorImage(window, &cursor->wl);
else else
{ {
defaultCursor = _glfwLoadCursor(GLFW_ARROW_CURSOR, window->wl.cursorTheme); _GLFWcursorWayland cursorWayland = {0};
if (!defaultCursor) return; cursorWayland.shape = GLFW_ARROW_CURSOR;
_GLFWcursorWayland cursorWayland = {
defaultCursor,
NULL,
0, 0,
0, 0,
0
};
setCursorImage(window, &cursorWayland); setCursorImage(window, &cursorWayland);
} }
} }