Commit 6aa1498b9818a1258468577d67ee04b7b10fde7f

Sam Lantinga 2021-08-13T11:03:19

This assert wasn't correct, we set the internal grab for mouse relative mode as well.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index d4078c3..38e6030 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2787,11 +2787,7 @@ SDL_SetWindowMouseGrab(SDL_Window * window, SDL_bool grabbed)
 SDL_bool
 SDL_GetWindowGrab(SDL_Window * window)
 {
-    CHECK_WINDOW_MAGIC(window, SDL_FALSE);
-    SDL_assert(!_this->grabbed_window ||
-               ((_this->grabbed_window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0) ||
-               ((_this->grabbed_window->flags & SDL_WINDOW_KEYBOARD_GRABBED) != 0));
-    return window == _this->grabbed_window;
+    return (SDL_GetWindowKeyboardGrab(window) || SDL_GetWindowMouseGrab(window));
 }
 
 SDL_bool