Browse Source

Also restore previous capture window if CaptureMouse() fails

Sam Lantinga 3 years ago
parent
commit
f9a9d3c8d4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/events/SDL_mouse.c

+ 2 - 0
src/events/SDL_mouse.c

@@ -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;
         }
     }