Commit 59690a4e976c852440b940c5cf97d105b5aed926

Sam Lantinga 2014-04-17T20:21:10

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c
index 0752695..780b448 100644
--- a/src/video/wayland/SDL_waylandmouse.c
+++ b/src/video/wayland/SDL_waylandmouse.c
@@ -267,13 +267,13 @@ Wayland_CreateSystemCursor(SDL_SystemCursor id)
         cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "xterm");
         break;
     case SDL_SYSTEM_CURSOR_WAIT:
-        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "wait");
+        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "watch");
         break;
     case SDL_SYSTEM_CURSOR_CROSSHAIR:
         cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "hand1");
         break;
     case SDL_SYSTEM_CURSOR_WAITARROW:
-        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "wait");
+        cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "watch");
         break;
     case SDL_SYSTEM_CURSOR_SIZENWSE:
         cursor = WAYLAND_wl_cursor_theme_get_cursor(d->cursor_theme, "hand1");