From 018d629b3cc6bf1d8424a73bbb00279223bfb323 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 18 Sep 2013 13:53:21 -0500 Subject: [PATCH] winemac: Use NSMouseInRect() instead of NSPointInRect() to compensate for Cocoa's off-by-one coordinate system. This matches what Cocoa does when determining how to handle an event so that, for example, our test if a click is in the window grow box corresponds to whether Cocoa will run an internal mouse-tracking loop to resize the window when we pass it the event. This fixes a problem where both Cocoa and user32 would try to run a resize loop and the cursor would get "stuck" resizing the window after the button was released. --- dlls/winemac.drv/cocoa_app.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index 615a9ab6e38..afe06089239 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -1550,7 +1550,7 @@ int macdrv_err_on; // Test if the click was in the window's content area. NSPoint nspoint = [self flippedMouseLocation:NSPointFromCGPoint(pt)]; NSRect contentRect = [window contentRectForFrameRect:[window frame]]; - process = NSPointInRect(nspoint, contentRect); + process = NSMouseInRect(nspoint, contentRect, NO); if (process && [window styleMask] & NSResizableWindowMask) { // Ignore clicks in the grow box (resize widget). @@ -1573,7 +1573,7 @@ int macdrv_err_on; NSMinY(contentRect), bounds.size.width, bounds.size.height); - process = !NSPointInRect(nspoint, growBox); + process = !NSMouseInRect(nspoint, growBox, NO); } } } @@ -1643,7 +1643,7 @@ int macdrv_err_on; // Only process the event if it was in the window's content area. NSPoint nspoint = [self flippedMouseLocation:NSPointFromCGPoint(pt)]; NSRect contentRect = [window contentRectForFrameRect:[window frame]]; - process = NSPointInRect(nspoint, contentRect); + process = NSMouseInRect(nspoint, contentRect, NO); } if (process) -- 2.11.4.GIT