diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index bf3d75b40..6f4b5afe8 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -714,7 +714,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) const SDL_bool isRelative = mouse->relative_mode || mouse->relative_mode_warp; const SDL_bool isCapture = ((data->window->flags & SDL_WINDOW_MOUSE_CAPTURE) != 0); - if (!isRelative || mouse->focus != data->window) { + /* Relative mouse motion is delivered to the window with keyboard focus */ + if (!isRelative || data->window != SDL_GetKeyboardFocus()) { if (!isCapture) { break; }