[file-roller] src/gtk-utils.c: Mark the accelerator activation has handled
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] src/gtk-utils.c: Mark the accelerator activation has handled
- Date: Tue, 23 Apr 2019 10:45:10 +0000 (UTC)
commit d94a7afd925c0c30e4934c8612ff63b319ea5ab1
Author: Andrea Azzarone <andrea azzarone canonical com>
Date: Fri Apr 19 12:57:07 2019 +0100
src/gtk-utils.c: Mark the accelerator activation has handled
The closure executed upon accelerator activation should return GDK_EVENT_STOP
(TRUE) if the event has been handled and GDK_EVENT_PROPAGATE otherwise. This
prevents CTRL+F to be activated twice for a single key press.
Closes: https://gitlab.gnome.org/GNOME/file-roller/issues/37
src/gtk-utils.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index 0a4cebe0..ebf95bc4 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -737,7 +737,7 @@ accel_data_free (gpointer user_data,
}
-static void
+static gboolean
window_accelerator_activated_cb (GtkAccelGroup *accel_group,
GObject *object,
guint key,
@@ -748,8 +748,12 @@ window_accelerator_activated_cb (GtkAccelGroup *accel_group,
GAction *action;
action = g_action_map_lookup_action (G_ACTION_MAP (accel_data->window), accel_data->action_name);
- if (action != NULL)
+ if (action != NULL) {
g_action_activate (action, accel_data->target);
+ return GDK_EVENT_STOP;
+ }
+
+ return GDK_EVENT_PROPAGATE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]