# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304199207 0 # Node ID c64d3ca566f935a6e8bf85b4ee4ab441829c6a64 # Parent 254b50be1bc1d19a26ece49aeb2fcc2a1dbb0b7d Attempt at inverting the window position and mouse pointer coordinates on Mac. diff -r 254b50be1bc1 -r c64d3ca566f9 mac/dw.m --- a/mac/dw.m Sat Apr 30 19:35:32 2011 +0000 +++ b/mac/dw.m Sat Apr 30 21:33:27 2011 +0000 @@ -6350,7 +6350,7 @@ } if(y) { - *y = mouseLoc.y; + *y = [[NSScreen mainScreen] frame].size.height - mouseLoc.y; } } @@ -6418,8 +6418,9 @@ NSView *view = [object isKindOfClass:[NSWindow class]] ? [object contentView] : parent; NSWindow *window = [view window]; NSEvent *event = [DWApp currentEvent]; + NSPoint p = NSMakePoint(x, [[NSScreen mainScreen] frame].size.height - y); NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown - location:[window convertScreenToBase:NSMakePoint(x, y)] + location:[window convertScreenToBase:p] modifierFlags:0 timestamp:[event timestamp] windowNumber:[window windowNumber] @@ -7533,7 +7534,7 @@ NSObject *object = handle; NSPoint point; point.x = x; - point.y = y; + point.y = [[NSScreen mainScreen] frame].size.height - y; if([ object isKindOfClass:[ NSWindow class ] ]) { @@ -7578,7 +7579,7 @@ if(x) *x = rect.origin.x; if(y) - *y = rect.origin.y; + *y = [[NSScreen mainScreen] frame].size.height - rect.origin.y; if(width) *width = rect.size.width; if(height)