浏览代码

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)
Sam Lantinga 4 年之前
父节点
当前提交
694771513c
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/events/SDL_mouse.c

+ 1 - 2
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;