13
0

Fix canvas tooltips

The tooltip should remain visible until the mouse leaves
the item's bounding box. Also do not start the tooltip
timeout if the item does not have a tooltip.
This commit is contained in:
Robin Gareus 2022-04-04 20:50:31 +02:00
parent 4f43d5d024
commit b58072f14c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -747,6 +747,10 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state)
DEBUG_TRACE (PBD::DEBUG::CanvasEnterLeave, string_compose ("LEAVE %1/%2\n", _current_item->whatami(), _current_item->name));
}
if (_current_item == current_tooltip_item) {
hide_tooltip ();
}
leave_event.detail = GDK_NOTIFY_VIRTUAL;
enter_event.detail = GDK_NOTIFY_VIRTUAL;
@ -1158,8 +1162,6 @@ GtkCanvas::get_mouse_position (Duple& winpos) const
bool
GtkCanvas::on_motion_notify_event (GdkEventMotion* ev)
{
hide_tooltip ();
/* translate event coordinates from window to canvas */
GdkEvent copy = *((GdkEvent*)ev);
@ -1379,7 +1381,7 @@ GtkCanvas::start_tooltip_timeout (Item* item)
{
stop_tooltip_timeout ();
if (item && Gtkmm2ext::PersistentTooltip::tooltips_enabled ()) {
if (item && !item->tooltip().empty() && Gtkmm2ext::PersistentTooltip::tooltips_enabled ()) {
current_tooltip_item = item;
/* wait for the first idle that happens after this is