Merge pull request #56788 from Chaosus/fix_input_process

Flush input events before destroying the window
This commit is contained in:
Rémi Verschelde 2022-01-14 19:54:39 +01:00 committed by GitHub
commit 4a22eca9a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2819,6 +2819,9 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
case WM_DEVICECHANGE: {
joypad->probe_joypads();
} break;
case WM_DESTROY: {
Input::get_singleton()->flush_buffered_events();
} break;
case WM_SETCURSOR: {
if (LOWORD(lParam) == HTCLIENT) {
if (windows[window_id].window_has_focus && (mouse_mode == MOUSE_MODE_HIDDEN || mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN)) {