summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-20 23:07:54 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-20 23:07:54 +0000
commitca4a101838945366b577a272ccd3857a51ed2974 (patch)
tree675e1048a5280ea355e6d6a3de3c9933ad2bf2e4 /chrome
parent5e49546581a5a4c2c02d718f9d6e3dbebd7bebc7 (diff)
downloadchromium_src-ca4a101838945366b577a272ccd3857a51ed2974.zip
chromium_src-ca4a101838945366b577a272ccd3857a51ed2974.tar.gz
chromium_src-ca4a101838945366b577a272ccd3857a51ed2974.tar.bz2
Fixes bug where tooltips would get stuck. This was happening because
on Vista we manage showing/hiding tooltips ourself. It would appear when managing our own tooltips like this we need to explicitly hide the tooltip. If you rapidly moved the mouse we wouldn't get a mouse move and the tooltip would stick. The fix is to have ContainerWin forward mouse leave and have the tooltip manager close the tooltip on mouse leave. BUG=2717 TEST=on vista do the following. Add a bookmark to the bookmark bar and hover the mouse over it. Then hit control-b so the bookmark bar disappears. Make sure the tooltip disappears too. Review URL: http://codereview.chromium.org/11540 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/views/aero_tooltip_manager.cc5
-rw-r--r--chrome/views/aero_tooltip_manager.h3
-rw-r--r--chrome/views/container_win.cc1
-rw-r--r--chrome/views/tooltip_manager.h2
4 files changed, 10 insertions, 1 deletions
diff --git a/chrome/views/aero_tooltip_manager.cc b/chrome/views/aero_tooltip_manager.cc
index 7e665a1..5977644 100644
--- a/chrome/views/aero_tooltip_manager.cc
+++ b/chrome/views/aero_tooltip_manager.cc
@@ -58,6 +58,11 @@ void AeroTooltipManager::OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param) {
}
}
+void AeroTooltipManager::OnMouseLeave() {
+ last_mouse_x_ = last_mouse_y_ = -1;
+ UpdateTooltip();
+}
+
///////////////////////////////////////////////////////////////////////////////
// AeroTooltipManager, private:
diff --git a/chrome/views/aero_tooltip_manager.h b/chrome/views/aero_tooltip_manager.h
index 28edda7..3b7b99a 100644
--- a/chrome/views/aero_tooltip_manager.h
+++ b/chrome/views/aero_tooltip_manager.h
@@ -31,7 +31,8 @@ class AeroTooltipManager : public TooltipManager {
AeroTooltipManager(Container* container, HWND parent);
virtual ~AeroTooltipManager();
- void OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param);
+ virtual void OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param);
+ virtual void OnMouseLeave();
private:
void Init();
diff --git a/chrome/views/container_win.cc b/chrome/views/container_win.cc
index 43286fb..dc011742 100644
--- a/chrome/views/container_win.cc
+++ b/chrome/views/container_win.cc
@@ -532,6 +532,7 @@ void ContainerWin::OnMouseMove(UINT flags, const CPoint& point) {
}
LRESULT ContainerWin::OnMouseLeave(UINT uMsg, WPARAM w_param, LPARAM l_param) {
+ tooltip_manager_->OnMouseLeave();
ProcessMouseExited();
return 0;
}
diff --git a/chrome/views/tooltip_manager.h b/chrome/views/tooltip_manager.h
index 5050923..f1aab66a 100644
--- a/chrome/views/tooltip_manager.h
+++ b/chrome/views/tooltip_manager.h
@@ -76,6 +76,8 @@ class TooltipManager {
// Message handlers. These forward to the tooltip control.
virtual void OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param);
LRESULT OnNotify(int w_param, NMHDR* l_param, bool* handled);
+ // Not used directly by TooltipManager, but provided for AeroTooltipManager.
+ virtual void OnMouseLeave() {}
protected:
virtual void Init();