Better error reporting when failing to load cursor

This commit is contained in:
Kovid Goyal
2019-03-21 10:38:26 +05:30
parent a2e47d2d0e
commit 733158a2de
2 changed files with 4 additions and 5 deletions

2
glfw/wl_init.c vendored
View File

@@ -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.

7
glfw/wl_window.c vendored
View File

@@ -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 = {