Application: Do not reuse Ctrl+F1 for help-overlay
authorDaniel Boles <dboles@src.gnome.org>
Fri, 24 Aug 2018 11:51:21 +0000 (14:51 +0300)
committerRobert Roth <robert.roth.off@gmail.com>
Fri, 24 Aug 2018 11:51:21 +0000 (14:51 +0300)
It just gets overridden to do something else, as the 1st GtkWidget’s
class_init() adds it as a binding to toggle tooltips with the keyboard.
The last entity to hook it (& return TRUE) is the only one who gets it.

So, worse: If users needed to manually set accels for a ShortcutsWindow,
coincidentally waited until after the 1st GtkWidget init() to do it, &
copied what GtkApplication said in an attempt to be good & consistent —
they inadvertently broke the keyboard tooltips (except for users with a
GDK_KEY_KP_F1 – whatever that is) as their handler blocked GtkWidget’s.

So, one side has to drop this accelerator, and it seems clear that being
able to open tooltips with the keyboard is more important than having a
second accel for the help-overlay. We can make up a replacement later.

https://gitlab.gnome.org/GNOME/gtk/issues/626

gtk/gtkapplication.c

index aab751ce66689aa4f005d4deacb6dfad90198742..6e0aea2c92f6dabe86ca695dae325ff8c55b0ee8 100644 (file)
  * If there is a resource located at "gtk/help-overlay.ui" which
  * defines a #GtkShortcutsWindow with ID "help_overlay" then GtkApplication
  * associates an instance of this shortcuts window with each
- * #GtkApplicationWindow and sets up keyboard accelerators (Control-F1
- * and Control-?) to open it. To create a menu item that displays the
+ * #GtkApplicationWindow and sets up the keyboard accelerator Control-?
+ * to open it. To create a menu item that displays the
  * shortcuts window, associate the item with the action win.show-help-overlay.
  *
  * ## A simple application ## {#gtkapplication}
@@ -270,7 +270,7 @@ gtk_application_load_resources (GtkApplication *application)
     path = g_strconcat (base_path, "/gtk/help-overlay.ui", NULL);
     if (g_resources_get_info (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
       {
-        const gchar * const accels[] = { "<Primary>F1", "<Primary>question", NULL };
+        const gchar * const accels[] = { "<Primary>question", NULL };
 
         priv->help_overlay_path = path;
         gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);