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.
This commit is contained in:
parent
e5f61e6eaf
commit
018d629b3c
dlls/winemac.drv
|
@ -1550,7 +1550,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
// 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 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
NSMinY(contentRect),
|
||||
bounds.size.width,
|
||||
bounds.size.height);
|
||||
process = !NSPointInRect(nspoint, growBox);
|
||||
process = !NSMouseInRect(nspoint, growBox, NO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1643,7 +1643,7 @@ - (void) handleScrollWheel:(NSEvent*)theEvent
|
|||
// 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)
|
||||
|
|
Loading…
Reference in New Issue