[gtk+/wip/baedert/box: 70/108] gtkwindow: Stop checking gtk-menu-bar-accel



commit 4c324e66e0a16bbd53120197c31c940b6b84e8e8
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 13 15:26:03 2016 +0200

    gtkwindow: Stop checking gtk-menu-bar-accel

 gtk/gtkwindow.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fa81608..b40328e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -149,6 +149,7 @@
  * widget that is added as a titlebar child.
  */
 
+#define MENU_BAR_ACCEL "F10"
 #define MNEMONICS_DELAY 300 /* ms */
 #define NO_CONTENT_CHILD_NAT 200
 /* In case the content (excluding header bar and shadows) of the window
@@ -10576,28 +10577,17 @@ gtk_window_activate_menubar (GtkWindow   *window,
                              GdkEventKey *event)
 {
   GtkWindowPrivate *priv = window->priv;
-  gchar *accel = NULL;
   guint keyval = 0;
   GdkModifierType mods = 0;
 
-  g_object_get (gtk_widget_get_settings (GTK_WIDGET (window)),
-                "gtk-menu-bar-accel", &accel,
-                NULL);
-
-  if (accel == NULL || *accel == 0)
-    return FALSE;
-
-  gtk_accelerator_parse (accel, &keyval, &mods);
+  gtk_accelerator_parse (MENU_BAR_ACCEL, &keyval, &mods);
 
   if (keyval == 0)
     {
-      g_warning ("Failed to parse menu bar accelerator '%s'", accel);
-      g_free (accel);
+      g_warning ("Failed to parse menu bar accelerator '%s'", MENU_BAR_ACCEL);
       return FALSE;
     }
 
-  g_free (accel);
-
   /* FIXME this is wrong, needs to be in the global accel resolution
    * thing, to properly consider i18n etc., but that probably requires
    * AccelGroup changes etc.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]