From 694771513cf7ef7525db3e2f439381edc3fc93c3 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 13 Aug 2021 23:45:01 -0700
Subject: [PATCH] Get the window size for the window receiving the mouse motion
This is the mouse focus except in the case where relative motion is enabled and the mouse is over a window floating on top of the application window (e.g. the taskbar)
---
src/events/SDL_mouse.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index aad433dc1f..e88489c4a5 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -412,8 +412,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
int x_max = 0, y_max = 0;
- /* !!! FIXME: shouldn't this be (window) instead of (mouse->focus)? */
- SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
+ SDL_GetWindowSize(window, &x_max, &y_max);
--x_max;
--y_max;