[gnome-settings-daemon] media-keys: Adjust to ShellKeyGrabber changes
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Adjust to ShellKeyGrabber changes
- Date: Fri, 19 Dec 2014 13:15:38 +0000 (UTC)
commit 46525602364088398eeb3a98d7bcfa64deeddd4e
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Dec 11 17:32:55 2014 +0100
media-keys: Adjust to ShellKeyGrabber changes
The AcceleratorActivated signal now uses a dictionary for additional
parameters to make future additions easier.
plugins/media-keys/gsd-media-keys-manager.c | 13 +++++++++++--
plugins/media-keys/org.gnome.ShellKeyGrabber.xml | 3 +--
2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index abd3984..f9d5a75 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2191,11 +2191,20 @@ do_action (GsdMediaKeysManager *manager,
static void
on_accelerator_activated (ShellKeyGrabber *grabber,
guint accel_id,
- guint deviceid,
- guint timestamp,
+ GVariant *parameters,
GsdMediaKeysManager *manager)
{
+ GVariantDict dict;
guint i;
+ guint deviceid;
+ guint timestamp;
+
+ g_variant_dict_init (&dict, parameters);
+
+ if (!g_variant_dict_lookup (&dict, "device-id", "u", &deviceid))
+ deviceid = 0;
+ if (!g_variant_dict_lookup (&dict, "timestamp", "u", ×tamp))
+ timestamp = GDK_CURRENT_TIME;
for (i = 0; i < manager->priv->keys->len; i++) {
MediaKey *key;
diff --git a/plugins/media-keys/org.gnome.ShellKeyGrabber.xml
b/plugins/media-keys/org.gnome.ShellKeyGrabber.xml
index b47e9c8..a245481 100644
--- a/plugins/media-keys/org.gnome.ShellKeyGrabber.xml
+++ b/plugins/media-keys/org.gnome.ShellKeyGrabber.xml
@@ -16,8 +16,7 @@
</method>
<signal name="AcceleratorActivated">
<arg type="u" name="action"/>
- <arg type="u" name="device"/>
- <arg type="u" name="timestamp"/>
+ <arg type="a{sv}" name="parameters"/>
</signal>
</interface>
</node>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]