changeset 711:82250177f814

Fix for popup menus not being created when window handle passed is a toplevel window.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 12 Mar 2011 06:19:35 +0000
parents 78460ff977c1
children 01107d8e033e
files mac/dw.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Sat Mar 12 06:03:32 2011 +0000
+++ b/mac/dw.m	Sat Mar 12 06:19:35 2011 +0000
@@ -5087,7 +5087,8 @@
 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y)
 {
     NSMenu *thismenu = (NSMenu *)*menu;
-    NSView *view = parent;
+    id object = parent;
+    NSView *view = [object isKindOfClass:[NSWindow class]] ? [object contentView] : parent;
     NSWindow *window = [view window];
     NSEvent *event = [DWApp currentEvent];
     NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown