summaryrefslogtreecommitdiffstats
path: root/chrome/views/tooltip_manager.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-19 15:25:12 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-19 15:25:12 +0000
commit0a161f322d061538c24cb51c1cf340123811cb9c (patch)
tree01ba1dcbdade77b024a1032ccacb8d1d0d8fa799 /chrome/views/tooltip_manager.cc
parent07f7352f819918267f080ece5b46db05362d9de1 (diff)
downloadchromium_src-0a161f322d061538c24cb51c1cf340123811cb9c.zip
chromium_src-0a161f322d061538c24cb51c1cf340123811cb9c.tar.gz
chromium_src-0a161f322d061538c24cb51c1cf340123811cb9c.tar.bz2
Fixes bug in tooltip manager. Mouse coordinates for NC events are in
screen coordinates and need to be converted. BUG=2523 TEST=see bug Review URL: http://codereview.chromium.org/3160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/tooltip_manager.cc')
-rw-r--r--chrome/views/tooltip_manager.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/views/tooltip_manager.cc b/chrome/views/tooltip_manager.cc
index cdac076..112d380 100644
--- a/chrome/views/tooltip_manager.cc
+++ b/chrome/views/tooltip_manager.cc
@@ -347,6 +347,15 @@ void TooltipManager::UpdateTooltip(int x, int y) {
void TooltipManager::OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param) {
int x = GET_X_LPARAM(l_param);
int y = GET_Y_LPARAM(l_param);
+
+ if (u_msg >= WM_NCMOUSEMOVE && u_msg <= WM_NCXBUTTONDBLCLK) {
+ // NC message coordinates are in screen coordinates.
+ CRect frame_bounds;
+ view_container_->GetBounds(&frame_bounds, true);
+ x -= frame_bounds.left;
+ y -= frame_bounds.top;
+ }
+
if (u_msg != WM_MOUSEMOVE || last_mouse_x_ != x || last_mouse_y_ != y) {
last_mouse_x_ = x;
last_mouse_y_ = y;