summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-04-12 02:34:19 +0200
committerRobin Gareus <robin@gareus.org>2018-04-12 02:54:55 +0200
commit4983eb565db219412d09b898286660e298a0176f (patch)
tree547e0158f1d533a6aca7119f22f1523349e03e31
parentd0539f5e8aa9900bcb991fbe35dcf15ef31211da (diff)
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.
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc9
1 files changed, 8 insertions, 1 deletions
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 {