Skip to content

Commit

Permalink
Also restore previous capture window if CaptureMouse() fails
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed May 19, 2022
1 parent 7044452 commit f9a9d3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/events/SDL_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@ SDL_UpdateMouseCapture(SDL_bool force_release)
if (capture_window) {
capture_window->flags &= ~SDL_WINDOW_MOUSE_CAPTURE;
}
mouse->capture_window = previous_capture;

return -1;
}
}
Expand Down

0 comments on commit f9a9d3c

Please sign in to comment.