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.
This commit is contained in:
Robin Gareus 2021-09-19 18:46:06 +02:00
parent 0b2b361b32
commit 5fb54c008d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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;