1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 01:42:38 +01:00

Fix: Viewport drag tooltips not being removed when dragging over other windows

This commit is contained in:
Jonathan G Rennison
2021-04-05 12:30:58 +01:00
committed by Charles Pigott
parent 35aff633bd
commit 30313bb396
3 changed files with 8 additions and 1 deletions

View File

@@ -767,6 +767,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;
}
}
}
};