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
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -390,13 +390,16 @@ UI::set_tip (Widget *w, const gchar *tip, const gchar *hlp)
} }
if (action) { if (action) {
Bindings* bindings = (Bindings*) w->get_data ("ardour-bindings"); /* get_bindings_from_widget_heirarchy */
if (!bindings) { Widget* ww = w;
Gtk::Window* win = (Gtk::Window*) w->get_toplevel(); Bindings* bindings = NULL;
if (win) { do {
bindings = (Bindings*) win->get_data ("ardour-bindings"); bindings = (Bindings*) ww->get_data ("ardour-bindings");
} if (bindings) {
break;
} }
ww = ww->get_parent ();
} while (ww);
if (!bindings) { if (!bindings) {
bindings = global_bindings; bindings = global_bindings;