From 733158a2deed87a66bd4ca61be16e649d3fa0f53 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Mar 2019 10:38:26 +0530 Subject: [PATCH] Better error reporting when failing to load cursor --- glfw/wl_init.c | 2 +- glfw/wl_window.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index a95f8dd19..680676d03 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -138,7 +138,7 @@ static void setCursor(const char* name) if (!cursor) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Standard cursor not found"); + "Wayland: Standard cursor %s not found", name); return; } // TODO: handle animated cursors too. diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 2e6d48414..db4157077 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -879,7 +879,7 @@ handleEvents(double timeout) // Translates a GLFW standard cursor to a theme cursor name // -static char *translateCursorShape(int shape) +static const char *translateCursorShape(int shape) { switch (shape) { @@ -1555,12 +1555,11 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) setCursorImage(&cursor->wl); else { - defaultCursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, - "left_ptr"); + defaultCursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, translateCursorShape(GLFW_ARROW_CURSOR)); if (!defaultCursor) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Standard cursor not found"); + "Wayland: Standard arrow cursor not found"); return; } _GLFWcursorWayland cursorWayland = {