Also restore previous capture window if CaptureMouse() fails

This commit is contained in:
Sam Lantinga 2022-05-18 17:23:49 -07:00
parent 7044452dd6
commit f9a9d3c8d4
1 changed files with 2 additions and 0 deletions

View File

@ -1052,6 +1052,8 @@ SDL_UpdateMouseCapture(SDL_bool force_release)
if (capture_window) { if (capture_window) {
capture_window->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; capture_window->flags &= ~SDL_WINDOW_MOUSE_CAPTURE;
} }
mouse->capture_window = previous_capture;
return -1; return -1;
} }
} }