need way to deactivate GtkWindow's F10 shortcut
gtkwindow.c:gtk_window_init contains this code:
shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (MENU_BAR_ACCEL, 0),
gtk_callback_action_new (gtk_window_activate_menubar, NULL, NULL));
gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut);
gtk_event_controller_set_name (controller, "gtk-window-menubar-accel");
gtk_widget_add_controller (widget, controller);
This unconditionally grabs F10 for gtk, but e.g. in vte all function keys belong to the terminal.
There seems to be no way to change the accel (in gtk3 one could set GtkSettings:gtk-menu-bar-accel
to something else/to NULL), nor a way remove the shortcut controller, except by calling the (documented as expensive/avoid using) gtk_widget_observe_controllers(), iterating the model to find the one with the name gtk-window-menubar-accel
(relying on its name being ABI, never changing) then using gtk_widget_remove_controller
.
This should be easier. Maybe add gtk_widget_remove_controller_by_name()
(which would still rely on the internal name), or a property on GtkWindow not to install the shortcut in the first place, or make the accel key configurable again like in gtk3.