diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index fe7d91dc18c..e99539f4fe1 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -3266,7 +3266,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA SetCapture(hWnd); } } else { - if (--pressrc <= 0) { + if (--pressrc <= 0 || last_button_state.is_empty()) { if (mouse_mode != MOUSE_MODE_CAPTURED) { ReleaseCapture(); }