From 5fb54c008d17f9b3df239b4529b43db99edb7614 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 19 Sep 2021 18:46:06 +0200 Subject: [PATCH] Fix shortcut display in editor tooltips #8798 After the editor is attached as tab to the main window, looking up keyboard bindings using get_toplevel() no longer works. This uses the widget-hierarchy just like ARDOUR_UI does. --- libs/gtkmm2ext/gtk_ui.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index d3335e3476..7167eb3449 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -390,13 +390,16 @@ UI::set_tip (Widget *w, const gchar *tip, const gchar *hlp) } if (action) { - Bindings* bindings = (Bindings*) w->get_data ("ardour-bindings"); - if (!bindings) { - Gtk::Window* win = (Gtk::Window*) w->get_toplevel(); - if (win) { - bindings = (Bindings*) win->get_data ("ardour-bindings"); + /* get_bindings_from_widget_heirarchy */ + Widget* ww = w; + Bindings* bindings = NULL; + do { + bindings = (Bindings*) ww->get_data ("ardour-bindings"); + if (bindings) { + break; } - } + ww = ww->get_parent (); + } while (ww); if (!bindings) { bindings = global_bindings;