Mercurial > dwindows
comparison mac/dw.m @ 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 | aac69b11e821 |
children | 75a773cdb626 |
comparison
equal
deleted
inserted
replaced
1224:cfe8608253a8 | 1225:f5b79d8b0694 |
---|---|
6823 NSMenu *thismenu = (NSMenu *)*menu; | 6823 NSMenu *thismenu = (NSMenu *)*menu; |
6824 id object = parent; | 6824 id object = parent; |
6825 NSView *view = [object isKindOfClass:[NSWindow class]] ? [object contentView] : parent; | 6825 NSView *view = [object isKindOfClass:[NSWindow class]] ? [object contentView] : parent; |
6826 NSWindow *window = [view window]; | 6826 NSWindow *window = [view window]; |
6827 NSEvent *event = [DWApp currentEvent]; | 6827 NSEvent *event = [DWApp currentEvent]; |
6828 if(!window) | |
6829 window = [event window]; | |
6828 NSPoint p = NSMakePoint(x, [[NSScreen mainScreen] frame].size.height - y); | 6830 NSPoint p = NSMakePoint(x, [[NSScreen mainScreen] frame].size.height - y); |
6829 NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown | 6831 NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown |
6830 location:[window convertScreenToBase:p] | 6832 location:[window convertScreenToBase:p] |
6831 modifierFlags:0 | 6833 modifierFlags:0 |
6832 timestamp:[event timestamp] | 6834 timestamp:[event timestamp] |