From f6f8f4b7429c9ec7b308bdf542afe0505ea05828 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 23 Jun 2019 16:18:24 +0000 Subject: [PATCH] shortcutaction: Just use gtk_widget_activate_action We can just rely on this, no need to do manual action group juggling here. --- gtk/gtkshortcutaction.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/gtk/gtkshortcutaction.c b/gtk/gtkshortcutaction.c index dfc999d44e..8eb55c6062 100644 --- a/gtk/gtkshortcutaction.c +++ b/gtk/gtkshortcutaction.c @@ -971,31 +971,11 @@ gtk_action_action_activate (GtkShortcutAction *action, GVariant *args) { GtkActionAction *self = (GtkActionAction *) action; - GActionGroup *action_group; - const GVariantType *parameter_type; - gboolean enabled; + GActionGroup *group; - action_group = G_ACTION_GROUP (_gtk_widget_get_action_muxer (widget, FALSE)); - if (action_group == NULL) - return FALSE; - - if (!g_action_group_query_action (action_group, self->name, &enabled, ¶meter_type, NULL, NULL, NULL)) - return FALSE; - - if (!enabled) - return FALSE; - - /* We found an action with the correct name and it's enabled. - * This is the action that we are going to try to invoke. - * - * There is still the possibility that the args don't - * match the expected parameter type. In that case, we will print - * a warning. - */ - if (!gtk_shortcut_trigger_check_parameter_type (args, parameter_type)) - return FALSE; - - g_action_group_activate_action (action_group, self->name, args); + group = G_ACTION_GROUP (_gtk_widget_get_action_muxer (widget, FALSE)); + if (group) + g_action_group_activate_action (group, self->name, args); return TRUE; }