diff options
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r-- | libdbusmenu-gtk/menuitem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index fd8246c..370dbf2 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -177,6 +177,9 @@ dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key, g_return_val_if_fail(DBUSMENU_IS_MENUITEM(menuitem), FALSE); g_return_val_if_fail(gtk_accelerator_valid(key, modifier), FALSE); + const gchar * keyname = gdk_keyval_name(key); + g_return_val_if_fail(keyname != NULL, FALSE); + GVariantBuilder builder; g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY); @@ -193,8 +196,6 @@ dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key, g_variant_builder_add(&builder, "s", DBUSMENU_MENUITEM_SHORTCUT_SUPER); } - const gchar * keyname = gdk_keyval_name(key); - g_return_val_if_fail(keyname != NULL, FALSE); g_variant_builder_add(&builder, "s", keyname); GVariant * inside = g_variant_builder_end(&builder); |