Fixed bug 2482 - Wayland_CreateSystemCursor trying to load nonexistent "wait" cursor
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Apr 2014 20:21:10 -0700
changeset 8710403c95143f8a
parent 8709 a4346af9eec4
child 8711 46f85bfe9303
Fixed bug 2482 - Wayland_CreateSystemCursor trying to load nonexistent "wait" cursor

Bryan Cain

Wayland_CreateSystemCursor tries to load a cursor named "wait" for two of the system cursor categories. This causes a segmentation fault when one of these cursors is used, because "wait" is not an actual cursor name in X11/Wayland cursor themes.

I can't attach my patch since I'm on a mobile right now, but I can confirm that simply replacing "wait" with "watch" for both of its uses in Wayland_CreateSystemCursor (in SDL_waylandmouse.c) fixes the bug.
src/video/wayland/SDL_waylandmouse.c
     1.1 --- a/src/video/wayland/SDL_waylandmouse.c	Thu Apr 17 20:18:50 2014 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandmouse.c	Thu Apr 17 20:21:10 2014 -0700
     1.3 @@ -267,13 +267,13 @@
     1.4          cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "xterm");
     1.5          break;
     1.6      case SDL_SYSTEM_CURSOR_WAIT:
     1.7 -        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "wait");
     1.8 +        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "watch");
     1.9          break;
    1.10      case SDL_SYSTEM_CURSOR_CROSSHAIR:
    1.11          cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "hand1");
    1.12          break;
    1.13      case SDL_SYSTEM_CURSOR_WAITARROW:
    1.14 -        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "wait");
    1.15 +        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "watch");
    1.16          break;
    1.17      case SDL_SYSTEM_CURSOR_SIZENWSE:
    1.18          cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "hand1");