diff options
author | Jonathan G Rennison <j.g.rennison@gmail.com> | 2021-04-05 12:30:58 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-04-08 19:34:45 +0200 |
commit | 3ede756d23b09f52a8099736d9a78abc966448b8 (patch) | |
tree | fc2ae1c2fd3744fc4c1d182dfe9bb0afd49458b6 /src/misc_gui.cpp | |
parent | ae94b2d29695d46813e93d26e05abb436f2bf396 (diff) | |
download | openttd-3ede756d23b09f52a8099736d9a78abc966448b8.tar.xz |
Fix: Viewport drag tooltips not being removed when dragging over other windows
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 65f98b365..2f538f2af 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -766,6 +766,12 @@ struct TooltipsWindow : public Window case TCC_RIGHT_CLICK: if (!_right_button_down) delete this; break; case TCC_HOVER: if (!_mouse_hovering) delete this; break; case TCC_NONE: break; + + case TCC_EXIT_VIEWPORT: { + Window *w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); + if (w == nullptr || IsPtInWindowViewport(w, _cursor.pos.x, _cursor.pos.y) == nullptr) delete this; + break; + } } } }; |