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.
oldstable
Ken Thomases 2013-09-18 13:53:21 -05:00 committed by Alexandre Julliard
parent e5f61e6eaf
commit 018d629b3c
1 changed files with 3 additions and 3 deletions

View File

@ -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)