[PATCH] winex11: Make GetCursorPos respect clipping and virtual screen size.

Lauri Kenttä lauri.kentta at gmail.com
Tue May 17 16:37:17 CDT 2011


---
 dlls/winex11.drv/mouse.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 8456d67..4bc741c 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -1245,8 +1245,17 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
     if (ret)
     {
         POINT old = *pos;
+        RECT clip = clipping_cursor ? clip_rect : virtual_screen_rect;
         pos->x = winX + virtual_screen_rect.left;
         pos->y = winY + virtual_screen_rect.top;
+        if (pos->x < clip.left)
+            pos->x = clip.left;
+        if (pos->x >= clip.right)
+            pos->x = clip.right - 1;
+        if (pos->y < clip.top)
+            pos->y = clip.top;
+        if (pos->y >= clip.bottom)
+            pos->y = clip.bottom - 1;
         TRACE( "pointer at (%d,%d) server pos %d,%d\n", pos->x, pos->y, old.x, old.y );
     }
     wine_tsx11_unlock();
-- 
1.7.5.1




More information about the wine-patches mailing list