13
0

Fix gtk assert on key-propagation

This can happen when starting Ardour with the Preference pane
as initial tab. The editor, mixer are not realized, so
-propagation fails with:
IA__gtk_widget_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
This commit is contained in:
Robin Gareus 2021-07-07 04:34:28 +02:00
parent b1ea0f3458
commit d60a6a890d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -236,7 +236,7 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
DEBUG_TRACE (DEBUG::Accelerators, "\tnot handled by binding activation, now propagate to window\n");
if (gtk_window_propagate_key_event (win, ev)) {
if (window.get_realized () && (!window.get_focus() || window.get_focus()->get_realized ()) && gtk_window_propagate_key_event (win, ev)) {
DEBUG_TRACE (DEBUG::Accelerators, "\tpropagate handled\n");
return true;
}
@ -247,7 +247,7 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
DEBUG_TRACE (DEBUG::Accelerators, "\tpropagate, then activate\n");
if (gtk_window_propagate_key_event (win, ev)) {
if (window.get_realized () && (!window.get_focus() || window.get_focus()->get_realized ()) && gtk_window_propagate_key_event (win, ev)) {
DEBUG_TRACE (DEBUG::Accelerators, "\thandled by propagate\n");
return true;
}