Commit 4fa21ee5edb6f00ae9d3489961e659745bd4f4d8

Sylvain 2023-03-28T09:28:17

Fixed bug #7515 - Window still grabbed after destroying

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 5f9eb2f..7e77491 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -3268,6 +3268,10 @@ void SDL_DestroyWindow(SDL_Window *window)
         display->fullscreen_window = NULL;
     }
 
+    if (_this->grabbed_window == window) {
+        _this->grabbed_window = NULL; /* ungrabbing input. */
+    }
+
     /* Now invalidate magic */
     window->magic = NULL;