From 4983eb565db219412d09b898286660e298a0176f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 12 Apr 2018 02:34:19 +0200 Subject: Only update tooltips if there is an actual change -- #7268 Changing a tooltip resets the timeout. In one particular case, while rolling, AudioClock::set() is calling set_tooltip() at a rate faster than the tooltip timeout and prevents tooltip from showing at all (even if there is no actual change to the tooltip text). Alas, there is no trivial fix for this UI side and there may be other such cases. A central check is more than practical. --- libs/gtkmm2ext/gtk_ui.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/gtkmm2ext') diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 0da8438045..c321d94d4f 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -483,7 +483,14 @@ UI::do_request (UIRequest* req) } else if (req->type == SetTip) { - gtk_widget_set_tooltip_markup (req->widget->gobj(), req->msg); + gchar* old = gtk_widget_get_tooltip_markup (req->widget->gobj()); + if ( + (old && req->msg && strcmp (old, req->msg)) + || + ((old == NULL) != (req->msg == NULL || req->msg[0] == '\0')) + ) { + gtk_widget_set_tooltip_markup (req->widget->gobj(), req->msg); + } } else { -- cgit v1.2.3