Ken Thomases : winemac: Apply cursor clipping to events that were in Cocoa' s queue when clipping started.

Alexandre Julliard julliard at winehq.org
Tue May 7 15:54:05 CDT 2013


Module: wine
Branch: master
Commit: 1c4d8938ec4da1c05f6ab3144fdc71014b61c000
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1c4d8938ec4da1c05f6ab3144fdc71014b61c000

Author: Ken Thomases <ken at codeweavers.com>
Date:   Tue May  7 03:00:46 2013 -0500

winemac: Apply cursor clipping to events that were in Cocoa's queue when clipping started.

---

 dlls/winemac.drv/cocoa_app.m |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index c518b4e..e8cca28 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -1177,6 +1177,9 @@ int macdrv_err_on;
             {
                 CGPoint point = CGEventGetLocation([anEvent CGEvent]);
 
+                if (clippingCursor)
+                    [self clipCursorLocation:&point];
+
                 event = macdrv_create_event(MOUSE_MOVED_ABSOLUTE, targetWindow);
                 event->mouse_moved.x = point.x;
                 event->mouse_moved.y = point.y;
@@ -1230,6 +1233,9 @@ int macdrv_err_on;
             CGPoint pt = CGEventGetLocation([theEvent CGEvent]);
             BOOL process;
 
+            if (clippingCursor)
+                [self clipCursorLocation:&pt];
+
             if (pressed)
             {
                 // Test if the click was in the window's content area.
@@ -1308,8 +1314,14 @@ int macdrv_err_on;
         {
             CGEventRef cgevent = [theEvent CGEvent];
             CGPoint pt = CGEventGetLocation(cgevent);
-            NSPoint nspoint = [self flippedMouseLocation:NSPointFromCGPoint(pt)];
-            NSRect contentRect = [window contentRectForFrameRect:[window frame]];
+            NSPoint nspoint;
+            NSRect contentRect;
+
+            if (clippingCursor)
+                [self clipCursorLocation:&pt];
+
+            nspoint = [self flippedMouseLocation:NSPointFromCGPoint(pt)];
+            contentRect = [window contentRectForFrameRect:[window frame]];
 
             // Only process the event if it was in the window's content area.
             if (NSPointInRect(nspoint, contentRect))




More information about the wine-cvs mailing list