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

This commit is contained in:
Ken Thomases 2013-05-07 03:00:46 -05:00 committed by Alexandre Julliard
parent d9ae2f3e38
commit 1c4d8938ec
1 changed files with 14 additions and 2 deletions

View File

@ -1177,6 +1177,9 @@ - (void) handleMouseMove:(NSEvent*)anEvent
{
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 @@ - (void) handleMouseButton:(NSEvent*)theEvent
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 @@ - (void) handleScrollWheel:(NSEvent*)theEvent
{
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))