summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-09 23:11:36 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-09 23:11:36 +0000
commit456152b2db14e57195d78dfda5b0549846dfa936 (patch)
tree9b05b62edbb04e41d1dde59ee6c7fcec26954fa8 /chrome/common
parent450f0dcd806aeb1aea81a64842a0cacef48c572b (diff)
downloadchromium_src-456152b2db14e57195d78dfda5b0549846dfa936.zip
chromium_src-456152b2db14e57195d78dfda5b0549846dfa936.tar.gz
chromium_src-456152b2db14e57195d78dfda5b0549846dfa936.tar.bz2
Fix a bug with positioning windows from a secondary monitor.
BUG=1327320 Review URL: http://codereview.chromium.org/1864 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/win_util.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc
index 6342f5d..9655478 100644
--- a/chrome/common/win_util.cc
+++ b/chrome/common/win_util.cc
@@ -599,9 +599,11 @@ void EnsureRectIsVisibleInRect(const gfx::Rect& parent_rect,
// SECOND, clamp x,y position to padding,padding so we don't position child
// windows in hyperspace.
- if (child_rect->x() < 0 || child_rect->x() > parent_rect.width())
+ // TODO(mpcomplete): I don't see what the second check in each 'if' does that
+ // isn't handled by the LAST set of 'ifs'. Maybe we can remove it.
+ if (child_rect->x() < 0 || child_rect->x() > parent_rect.right())
child_rect->set_x(padding);
- if (child_rect->y() < 0 || child_rect->y() > parent_rect.height())
+ if (child_rect->y() < 0 || child_rect->y() > parent_rect.bottom())
child_rect->set_y(padding);
// LAST, nudge the window back up into the client area if its x,y position is