Fixed a message box getting the mouse capture state out of sync

This commit is contained in:
Sam Lantinga
2022-05-18 15:29:59 -07:00
parent 622311c016
commit e19a9a7931
3 changed files with 16 additions and 7 deletions

View File

@@ -1019,7 +1019,8 @@ SDL_UpdateMouseCapture(SDL_bool force_release)
}
if (!force_release) {
if (mouse->capture_desired || (mouse->auto_capture && SDL_GetMouseState(NULL, NULL) != 0)) {
if (SDL_GetMessageBoxCount() == 0 &&
(mouse->capture_desired || (mouse->auto_capture && SDL_GetMouseState(NULL, NULL) != 0))) {
if (!mouse->relative_mode) {
capture_window = SDL_GetKeyboardFocus();
}