diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-13 01:16:16 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-13 01:16:16 +0000 |
commit | 3d7ab72b0c0a6b43fa69985e6d6b39ec66dac6af (patch) | |
tree | cf228416beee46ad98fc37879de8cada7348c394 /chrome/browser/automation | |
parent | 3fc061bf7d66db91ad6e2357420f0e16ffcb3827 (diff) | |
download | chromium_src-3d7ab72b0c0a6b43fa69985e6d6b39ec66dac6af.zip chromium_src-3d7ab72b0c0a6b43fa69985e6d6b39ec66dac6af.tar.gz chromium_src-3d7ab72b0c0a6b43fa69985e6d6b39ec66dac6af.tar.bz2 |
Fix Mac window frame coordinate conversion on multiple monitor setups
The same bug exists in our event coordinate conversion code in WebInputEventFactory, so this is half of a two-sided patch; WebKit side is:
https://bugs.webkit.org/show_bug.cgi?id=35950
BUG=36621
TEST=In conjuction with the WebKit patch, mouseovers in Carbon plugins will work when the plugin is on a non-primary monitor with a different height than the primary monitor.
Review URL: http://codereview.chromium.org/751002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider_mac.mm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/automation/automation_provider_mac.mm b/chrome/browser/automation/automation_provider_mac.mm index b475f4d..e17d59c 100644 --- a/chrome/browser/automation/automation_provider_mac.mm +++ b/chrome/browser/automation/automation_provider_mac.mm @@ -22,10 +22,11 @@ void AutomationProvider::SetWindowBounds(int handle, const gfx::Rect& bounds, if (window) { NSRect new_bounds = NSRectFromCGRect(bounds.ToCGRect()); - // This is likely incorrect for a multiple-monitor setup; OK because this - // is used only for testing purposes. - new_bounds.origin.y = [[window screen] frame].size.height - - new_bounds.origin.y - new_bounds.size.height; + if ([[NSScreen screens] count] > 0) { + new_bounds.origin.y = + [[[NSScreen screens] objectAtIndex:0] frame].size.height - + new_bounds.origin.y - new_bounds.size.height; + } [window setFrame:new_bounds display:NO]; *success = true; |