# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1299822977 0 # Node ID e9a3d1da3d3e4c3e5f0b79ca49189dbe371fa6ae # Parent c91a1b345f2e5974b7fcec6b8b300bbf910389d9 dw_menu_popup() now uses the coordinates specified instead of the event coorindates. diff -r c91a1b345f2e -r e9a3d1da3d3e mac/dw.m --- a/mac/dw.m Fri Mar 11 05:23:17 2011 +0000 +++ b/mac/dw.m Fri Mar 11 05:56:17 2011 +0000 @@ -4957,10 +4957,20 @@ */ void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) { - NSMenu *thismenu = (NSMenu *)*menu; - NSView *view = parent; + NSMenu *thismenu = (NSMenu *)*menu; + NSView *view = parent; + NSWindow *window = [view window]; NSEvent *event = [DWApp currentEvent]; - [NSMenu popUpContextMenu:thismenu withEvent:event forView:view]; + NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown + location:[window convertScreenToBase:NSMakePoint(x, y)] + modifierFlags:0 + timestamp:[event timestamp] + windowNumber:[window windowNumber] + context:[NSGraphicsContext currentContext] + eventNumber:1 + clickCount:1 + pressure:0.0]; + [NSMenu popUpContextMenu:thismenu withEvent:fake forView:view]; } char _removetilde(char *dest, char *src)