diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 21:42:01 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 21:42:01 +0000 |
commit | d2cac6af37cc550c7e63bfaf27784df072e49f2a (patch) | |
tree | 8a1eac27343088f3736d591aa991196a0cd7f700 /webkit/glue/webmenurunner_mac.mm | |
parent | 4eb0b3f63044af36710bf16552dcb1c39f573cec (diff) | |
download | chromium_src-d2cac6af37cc550c7e63bfaf27784df072e49f2a.zip chromium_src-d2cac6af37cc550c7e63bfaf27784df072e49f2a.tar.gz chromium_src-d2cac6af37cc550c7e63bfaf27784df072e49f2a.tar.bz2 |
Fix select menu placement on 10.5
BUG=19669
TEST=Open a select menu at the bottom of the screen on 10.5; it should show up above the menu, not at the top of the screen.
Review URL: http://codereview.chromium.org/2884068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmenurunner_mac.mm')
-rw-r--r-- | webkit/glue/webmenurunner_mac.mm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webkit/glue/webmenurunner_mac.mm b/webkit/glue/webmenurunner_mac.mm index e4c8a4b..b7e48ba 100644 --- a/webkit/glue/webmenurunner_mac.mm +++ b/webkit/glue/webmenurunner_mac.mm @@ -131,11 +131,19 @@ BOOL gNewNSMenuAPI; [button selectItemAtIndex:index]; [button setFont:[NSFont menuFontOfSize:fontSize_]]; + // Create a dummy view to associate the popup with, since the OS will use + // that view for positioning the menu. + NSView* dummyView = [[[NSView alloc] initWithFrame:bounds] autorelease]; + [view addSubview:dummyView]; + NSRect dummyBounds = [dummyView convertRect:bounds fromView:view]; + // Display the menu, and set a flag if a menu item was chosen. - [button performClickWithFrame:bounds inView:view]; + [button performClickWithFrame:dummyBounds inView:dummyView]; if ([self menuItemWasChosen]) index_ = [button indexOfSelectedItem]; + + [dummyView removeFromSuperview]; } } |