diff options
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index b4d02591e9..d574ece427 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -347,14 +347,14 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) #endif if (focus) { - if (GTK_IS_ENTRY(focus)) { + if (GTK_IS_ENTRY(focus) || Keyboard::some_magic_widget_has_focus()) { special_handling_of_unmodified_accelerators = true; } } #ifdef DEBUG_ACCELERATOR_HANDLING if (debug) { - cerr << "Key event: code = " << ev->keyval << " state = " << hex << ev->state << dec << " focus is an entry ? " + cerr << "Win = " << win << " Key event: code = " << ev->keyval << " state = " << hex << ev->state << dec << " special handling ? " << special_handling_of_unmodified_accelerators << endl; } @@ -456,14 +456,25 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) /* no modifiers, propagate first */ #ifdef DEBUG_ACCELERATOR_HANDLING + if (debug) { + cerr << "\tpropagate, then activate\n"; + } +#endif + if (!gtk_window_propagate_key_event (win, ev)) { +#ifdef DEBUG_ACCELERATOR_HANDLING if (debug) { - cerr << "\tactivate, then propagate\n"; + cerr << "\tpropagation didn't handle, so activate\n"; } #endif - if (!gtk_window_propagate_key_event (win, ev)) { return gtk_window_activate_key (win, ev); - } - + } else { +#ifdef DEBUG_ACCELERATOR_HANDLING + if (debug) { + cerr << "\thandled by propagate\n"; + } +#endif + return true; + } #ifdef DEBUG_ACCELERATOR_HANDLING if (debug) { |