summaryrefslogtreecommitdiffstats
path: root/libraries/agar/463ea0a-sdl_hint_mouse_auto_capture.diff
blob: 8d84249a2efc65dcfc9749cce706551a0577a743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/gui/drv_sdl2mw.c b/gui/drv_sdl2mw.c
index a196e1e4e..ddf89d537 100644
--- a/gui/drv_sdl2mw.c
+++ b/gui/drv_sdl2mw.c
@@ -150,10 +150,11 @@ SDL2MW_Open(void *_Nonnull obj, const char *_Nullable spec)
 	drv->flags |= AG_DRIVER_WINDOW_BG;
 
 	if (nDrivers == 0) {			/* Root driver instance */
+#ifdef SDL_HINT_MOUSE_AUTO_CAPTURE
 		if (AG_Defined(drv, "noAutoCapture") &&
 		    AG_GetInt(drv, "noAutoCapture"))
 			SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "0");
-
+#endif
 		/* Enable the joystick subsystem if requested. */
 		if (AG_Defined(drv, "ctrl")) {
 			Uint32 sdlFlags = SDL_INIT_GAMECONTROLLER;
@@ -753,6 +754,7 @@ SDL2MW_SetWindowMaxSize(AG_Window *_Nonnull win, int w, int h)
 static void
 SDL2MW_SetMouseAutoCapture(void *_Nonnull obj, int state)
 {
+#ifdef SDL_HINT_MOUSE_AUTO_CAPTURE
 	if (state == 0) {
 		SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "0");
 	} else if (state == -1) {
@@ -760,6 +762,7 @@ SDL2MW_SetMouseAutoCapture(void *_Nonnull obj, int state)
 	} else {
 		SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "1");
 	}
+#endif
 }
 
 #if defined(AG_WIDGETS) && defined(AG_DEBUG)