diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-06-23 16:18:24 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-06-24 22:40:29 +0000 |
commit | f6f8f4b7429c9ec7b308bdf542afe0505ea05828 (patch) | |
tree | 58ac5c0bc1b2236343a50b9135ccd37580efbff6 | |
parent | 318ac2f8234f3d7002fa1329c345641fb828c024 (diff) | |
download | gtk+-f6f8f4b7429c9ec7b308bdf542afe0505ea05828.tar.gz |
shortcutaction: Just use gtk_widget_activate_action
We can just rely on this, no need to do manual
action group juggling here.
-rw-r--r-- | gtk/gtkshortcutaction.c | 28 |
1 files 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; } |