changeset 1225:f5b79d8b0694

Fixed positioning popup menu when the controlling window is not visible on Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 10 Oct 2011 08:09:03 +0000
parents cfe8608253a8
children d865c29fc06a
files mac/dw.m
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Mon Oct 10 05:27:14 2011 +0000
+++ b/mac/dw.m	Mon Oct 10 08:09:03 2011 +0000
@@ -6825,6 +6825,8 @@
     NSView *view = [object isKindOfClass:[NSWindow class]] ? [object contentView] : parent;
     NSWindow *window = [view window];
     NSEvent *event = [DWApp currentEvent];
+    if(!window)
+        window = [event window];
     NSPoint p = NSMakePoint(x, [[NSScreen mainScreen] frame].size.height - y);
     NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown
                                        location:[window convertScreenToBase:p]