Commit 1c4d8938 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

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

parent d9ae2f3e
...@@ -1177,6 +1177,9 @@ int macdrv_err_on; ...@@ -1177,6 +1177,9 @@ int macdrv_err_on;
{ {
CGPoint point = CGEventGetLocation([anEvent CGEvent]); CGPoint point = CGEventGetLocation([anEvent CGEvent]);
if (clippingCursor)
[self clipCursorLocation:&point];
event = macdrv_create_event(MOUSE_MOVED_ABSOLUTE, targetWindow); event = macdrv_create_event(MOUSE_MOVED_ABSOLUTE, targetWindow);
event->mouse_moved.x = point.x; event->mouse_moved.x = point.x;
event->mouse_moved.y = point.y; event->mouse_moved.y = point.y;
...@@ -1230,6 +1233,9 @@ int macdrv_err_on; ...@@ -1230,6 +1233,9 @@ int macdrv_err_on;
CGPoint pt = CGEventGetLocation([theEvent CGEvent]); CGPoint pt = CGEventGetLocation([theEvent CGEvent]);
BOOL process; BOOL process;
if (clippingCursor)
[self clipCursorLocation:&pt];
if (pressed) if (pressed)
{ {
// Test if the click was in the window's content area. // Test if the click was in the window's content area.
...@@ -1308,8 +1314,14 @@ int macdrv_err_on; ...@@ -1308,8 +1314,14 @@ int macdrv_err_on;
{ {
CGEventRef cgevent = [theEvent CGEvent]; CGEventRef cgevent = [theEvent CGEvent];
CGPoint pt = CGEventGetLocation(cgevent); CGPoint pt = CGEventGetLocation(cgevent);
NSPoint nspoint = [self flippedMouseLocation:NSPointFromCGPoint(pt)]; NSPoint nspoint;
NSRect contentRect = [window contentRectForFrameRect:[window frame]]; 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. // Only process the event if it was in the window's content area.
if (NSPointInRect(nspoint, contentRect)) if (NSPointInRect(nspoint, contentRect))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment