mirror of
https://github.com/encounter/SDL.git
synced 2025-12-17 00:47:15 +00:00
Handle interaction between auto capture and the SDL_CaptureMouse() API
Fixes https://github.com/libsdl-org/SDL/issues/5457
This commit is contained in:
@@ -638,6 +638,7 @@ SDL_SetKeyboardFocus(SDL_Window * window)
|
||||
/* old window must lose an existing mouse capture. */
|
||||
if (keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE) {
|
||||
SDL_CaptureMouse(SDL_FALSE); /* drop the capture. */
|
||||
SDL_UpdateMouseCapture(SDL_TRUE);
|
||||
SDL_assert(!(keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user