Handle interaction between auto capture and the SDL_CaptureMouse() API
Fixes https://github.com/libsdl-org/SDL/issues/5457
This commit is contained in:
parent
0e198a8799
commit
86acb1a347
3 changed files with 55 additions and 31 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue