summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2015-04-09 15:42:00 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2015-04-09 15:42:00 +0100
commit2234fd4b8af2e2cbb28bbe41f35b334671aebcae (patch)
tree89d0ec8da990aec63476a2567fbf049b320f3829
parent85e701880b125fc866a88236bf5bf971eaebf91b (diff)
Delete a canvas tooltip after we've finished with it
All canvas objects share just one tooltip object which is based around Gtk::Label. The Label expands if the current tooltip text is wider than the previous text. However, it doesn't shrink again if the next tooltip has shorter text. Eventually, this results in some very strange looking tooltips (especially in Mixbus where they're used quite extensively). Deleting the object after use will force a new object to get generated next time (at the correct size). There's still only ever one object per canvas but it's no longer persistent.
-rw-r--r--libs/canvas/canvas.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc
index cc588cf3e1..11abd1a7d5 100644
--- a/libs/canvas/canvas.cc
+++ b/libs/canvas/canvas.cc
@@ -1211,6 +1211,11 @@ GtkCanvas::hide_tooltip ()
if (tooltip_window) {
tooltip_window->hide ();
+
+ // Delete the tooltip window so it'll get re-created
+ // (i.e. properly re-sized) on the next usage.
+ delete tooltip_window;
+ tooltip_window = NULL;
}
}