summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-08-19 08:22:08 +0000
committerterkhen <terkhen@openttd.org>2010-08-19 08:22:08 +0000
commitcfc0df152b40c7109ce6c2e60f80304fc97adb89 (patch)
tree8aa7c5afb95d9806c589a14e6984f22969a4d020 /src/misc_gui.cpp
parenta054078920536fac36179d542a7b4b920ba7956c (diff)
downloadopenttd-cfc0df152b40c7109ce6c2e60f80304fc97adb89.tar.xz
(svn r20552) -Fix: Never show tooltips when the mouse cursor is outside the window.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 7806188fc..3c31ddc0e 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -890,8 +890,14 @@ struct TooltipsWindow : public Window
virtual void OnMouseLoop()
{
+ /* Always close tooltips when the cursor is not in our window. */
+ if (!_cursor.in_window) {
+ delete this;
+ return;
+ }
+
/* We can show tooltips while dragging tools. These are shown as long as
- * we are dragging the tool. Normal tooltips work with rmb */
+ * we are dragging the tool. Normal tooltips work with hover or rmb. */
switch (this->close_cond) {
case TCC_RIGHT_CLICK: if (!_right_button_down) delete this; break;
case TCC_LEFT_CLICK: if (!_left_button_down) delete this; break;