Fix mouse focus being set to null when a captured mouse cursor leaves the window.

This commit is contained in:
Rémy Tassoux 2021-10-12 18:35:52 +02:00 committed by Sam Lantinga
parent 9ee6942e79
commit 6e356e20ad

View File

@ -979,6 +979,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
being lost. This then causes a cascading failure where SDL_WINDOWEVENT_ENTER / SDL_WINDOWEVENT_LEAVE
can stop firing permanently, due to the focus being in the wrong state and TrackMouseEvent never
resubscribing. */
const SDL_bool isCapture = ((data->window->flags & SDL_WINDOW_MOUSE_CAPTURE) != 0);
if (!isCapture)
SDL_SetMouseFocus(NULL);
returnCode = 0;