mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-02-25 19:16:51 +00:00
Don't drop mouse focus on WM_MOUSELEAVE if the mouse is in relative mode; mouse-level is not meaningful for that case.
Do drop mouse focus when keyboard focus is lost if the mouse is in relative mode.
This commit is contained in:
parent
0253a45029
commit
adf3ce7c01
|
@ -451,6 +451,10 @@ WIN_UpdateFocus(SDL_Window *window, SDL_bool expect_focus)
|
||||||
data->in_window_deactivation = SDL_TRUE;
|
data->in_window_deactivation = SDL_TRUE;
|
||||||
|
|
||||||
SDL_SetKeyboardFocus(NULL);
|
SDL_SetKeyboardFocus(NULL);
|
||||||
|
/* In relative mode we are guaranteed to not have mouse focus if we don't have keyboard focus */
|
||||||
|
if (SDL_GetMouse()->relative_mode) {
|
||||||
|
SDL_SetMouseFocus(NULL);
|
||||||
|
}
|
||||||
WIN_ResetDeadKeys();
|
WIN_ResetDeadKeys();
|
||||||
|
|
||||||
if (GetClipCursor(&rect) && SDL_memcmp(&rect, &data->cursor_clipped_rect, sizeof(rect)) == 0) {
|
if (GetClipCursor(&rect) && SDL_memcmp(&rect, &data->cursor_clipped_rect, sizeof(rect)) == 0) {
|
||||||
|
@ -943,9 +947,11 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SDL_GetMouse()->relative_mode) {
|
||||||
/* When WM_MOUSELEAVE is fired we can be assured that the cursor has left the window */
|
/* When WM_MOUSELEAVE is fired we can be assured that the cursor has left the window */
|
||||||
SDL_SetMouseFocus(NULL);
|
SDL_SetMouseFocus(NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Once we get WM_MOUSELEAVE we're guaranteed that the window is no longer tracked */
|
/* Once we get WM_MOUSELEAVE we're guaranteed that the window is no longer tracked */
|
||||||
data->mouse_tracked = SDL_FALSE;
|
data->mouse_tracked = SDL_FALSE;
|
||||||
|
|
Loading…
Reference in a new issue