[gnome-flashback] common: move parameters back to shell
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] common: move parameters back to shell
- Date: Mon, 28 Sep 2015 04:34:05 +0000 (UTC)
commit d22f59abe60af4acab3e2db96e85cd56ce1ddabe
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Sep 28 00:42:39 2015 +0300
common: move parameters back to shell
gnome-flashback/libcommon/gf-keybindings.c | 36 ++------------------
.../libinput-sources/gf-input-source-manager.c | 1 -
gnome-flashback/libshell/flashback-shell.c | 26 ++++++++++++++-
3 files changed, 28 insertions(+), 35 deletions(-)
---
diff --git a/gnome-flashback/libcommon/gf-keybindings.c b/gnome-flashback/libcommon/gf-keybindings.c
index ee1d5d2..80c88af 100644
--- a/gnome-flashback/libcommon/gf-keybindings.c
+++ b/gnome-flashback/libcommon/gf-keybindings.c
@@ -116,29 +116,6 @@ get_keybinding (GfKeybindings *keybindings,
return keybinding;
}
-static GVariant *
-build_parameters (guint device_id,
- guint timestamp,
- guint action_mode)
-{
- GVariantBuilder *builder;
- GVariant *parameters;
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
-
- g_variant_builder_add (builder, "{sv}", "device-id",
- g_variant_new_uint32 (device_id));
- g_variant_builder_add (builder, "{sv}", "timestamp",
- g_variant_new_uint32 (timestamp));
- g_variant_builder_add (builder, "{sv}", "action-mode",
- g_variant_new_uint32 (action_mode));
-
- parameters = g_variant_new ("a{sv}", builder);
- g_variant_builder_unref (builder);
-
- return parameters;
-}
-
static GdkFilterReturn
filter_func (GdkXEvent *xevent,
GdkEvent *event,
@@ -170,13 +147,9 @@ filter_func (GdkXEvent *xevent,
if (keybinding->keycode == ev->xkey.keycode &&
keybinding->mask == state)
{
- GVariant *parameters;
-
- parameters = build_parameters (0, 0, 0);
-
XUngrabKeyboard (keybindings->xdisplay, ev->xkey.time);
g_signal_emit (keybindings, signals[SIGNAL_ACCELERATOR_ACTIVATED],
- 0, keybinding->action, parameters);
+ 0, keybinding->action);
break;
}
@@ -342,17 +315,14 @@ gf_keybindings_class_init (GfKeybindingsClass *keybindings_class)
* GfKeybindings::accelerator-activated:
* @keybindings: the object on which the signal is emitted
* @action: keybinding action from gf_keybindings_grab
- * @parameters: keybinding parameters - a{sv}
*
* The ::accelerator-activated signal is emitted each time when keybinding
* is activated by user.
*/
signals[SIGNAL_ACCELERATOR_ACTIVATED] =
g_signal_new ("accelerator-activated",
- G_TYPE_FROM_CLASS (keybindings_class),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL, G_TYPE_NONE,
- 2, G_TYPE_UINT, G_TYPE_VARIANT);
+ G_TYPE_FROM_CLASS (keybindings_class), G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT);
}
static void
diff --git a/gnome-flashback/libinput-sources/gf-input-source-manager.c
b/gnome-flashback/libinput-sources/gf-input-source-manager.c
index 943413d..3f01df5 100644
--- a/gnome-flashback/libinput-sources/gf-input-source-manager.c
+++ b/gnome-flashback/libinput-sources/gf-input-source-manager.c
@@ -229,7 +229,6 @@ fade_finished_cb (GfInputSourcePopup *popup,
static void
accelerator_activated_cb (GfKeybindings *keybindings,
guint action,
- GVariant *parameters,
gpointer user_data)
{
GfInputSourceManager *manager;
diff --git a/gnome-flashback/libshell/flashback-shell.c b/gnome-flashback/libshell/flashback-shell.c
index e633a59..3d978c4 100644
--- a/gnome-flashback/libshell/flashback-shell.c
+++ b/gnome-flashback/libshell/flashback-shell.c
@@ -55,17 +55,41 @@ struct _FlashbackShell
G_DEFINE_TYPE (FlashbackShell, flashback_shell, G_TYPE_OBJECT)
+static GVariant *
+build_parameters (guint device_id,
+ guint timestamp,
+ guint action_mode)
+{
+ GVariantBuilder *builder;
+ GVariant *parameters;
+
+ builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
+
+ g_variant_builder_add (builder, "{sv}", "device-id",
+ g_variant_new_uint32 (device_id));
+ g_variant_builder_add (builder, "{sv}", "timestamp",
+ g_variant_new_uint32 (timestamp));
+ g_variant_builder_add (builder, "{sv}", "action-mode",
+ g_variant_new_uint32 (action_mode));
+
+ parameters = g_variant_new ("a{sv}", builder);
+ g_variant_builder_unref (builder);
+
+ return parameters;
+}
+
static void
accelerator_activated (GfKeybindings *keybindings,
guint action,
- GVariant *parameters,
gpointer user_data)
{
FlashbackShell *shell;
FlashbackDBusShell *dbus_shell;
+ GVariant *parameters;
shell = FLASHBACK_SHELL (user_data);
dbus_shell = FLASHBACK_DBUS_SHELL (shell->iface);
+ parameters = build_parameters (0, 0, 0);
flashback_dbus_shell_emit_accelerator_activated (dbus_shell, action, parameters);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]