GNOME Bugzilla – Bug 778738
Convert single keystroke commands to use action signals
Last modified: 2019-11-20 16:15:34 UTC
Switching to action signals[0] shortcuts for single keystroke commands (SKCs) will enable us to remove a gross hack, and support improving SKC for a dedicated "GMail-mode" and also allow people to customise SKC's themselves in GTK CSS in the future. The default GtkWindow key press event handler by default basically does the following for each event: 1. Call gtk_window_activate_key 2. If not handled, call gtk_window_propagate_key_event 3. Finally, if not handled then call gtk_bindings_activate_event To support the current implementation of single keystroke commands that uses the keyboard shortcuts mechanism, but to prevent it interfering with embedded composers and to avoid some issues with how WebKit handles events, we need to override the default implementation to reverse the order in which (1) and (2) are called — see MainWindow::key_press_event. This also causes some other odd behaviour however, such as Bug 730495. If we switch to using the action signal mechanism, then the issue goes away, since the SKCs will only be processed at step (3) above, and we can remove the hack in MainWindow::key_press_event. This means adding a signal annotated "[Signal (action=true)]" for each possible SKC to the appropriate widget (MainWindow? ConversationViewer?), using Gtk.BindingEntry.add_signal on the widget's BindingSet to add the SKCs, then removing the MainWindow hack above and the old machinery used to hook up SKCs. [0] - See "Signal Actions": https://blogs.gnome.org/chergert/2016/11/14/accelerators-a-history-lesson/ and gtk_binding_entry_add_signal()
Bump tickets to 0.14 that aren't going to make 0.13.
Landing over in https://gitlab.gnome.org/GNOME/geary/merge_requests/373