Browse Source

Merge pull request #72720 from pkdawson/fix-mouse-capture

DisplayServerWindows: Fix mouse capture when button up message is missed
Rémi Verschelde 2 years ago
parent
commit
d586096415
1 changed files with 1 additions and 1 deletions
  1. 1 1
      platform/windows/display_server_windows.cpp

+ 1 - 1
platform/windows/display_server_windows.cpp

@@ -3333,7 +3333,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
 						SetCapture(hWnd);
 						SetCapture(hWnd);
 					}
 					}
 				} else {
 				} else {
-					if (--pressrc <= 0) {
+					if (--pressrc <= 0 || last_button_state.is_empty()) {
 						if (mouse_mode != MOUSE_MODE_CAPTURED) {
 						if (mouse_mode != MOUSE_MODE_CAPTURED) {
 							ReleaseCapture();
 							ReleaseCapture();
 						}
 						}