diff options
Diffstat (limited to 'libraries/agar/463ea0a-sdl_hint_mouse_auto_capture.diff')
-rw-r--r-- | libraries/agar/463ea0a-sdl_hint_mouse_auto_capture.diff | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libraries/agar/463ea0a-sdl_hint_mouse_auto_capture.diff b/libraries/agar/463ea0a-sdl_hint_mouse_auto_capture.diff new file mode 100644 index 0000000000..8d84249a2e --- /dev/null +++ b/libraries/agar/463ea0a-sdl_hint_mouse_auto_capture.diff @@ -0,0 +1,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) |