diff options
author | infirit <[email protected]> | 2014-12-13 16:58:52 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-13 22:47:07 +0100 |
commit | ecd6cb8c49b07e7fe141205c8da677aed1ad3fb1 (patch) | |
tree | c05df28e58d4ebcad8f6b460c180e2f1432e3df3 /plugins/media-keys/msd-media-keys-manager.c | |
parent | 5f721f4f9ae4c95cf02e25e988e32b98dd653a87 (diff) | |
download | mate-settings-daemon-ecd6cb8c49b07e7fe141205c8da677aed1ad3fb1.tar.bz2 mate-settings-daemon-ecd6cb8c49b07e7fe141205c8da677aed1ad3fb1.tar.xz |
media-keys: Add ability to hard-code keys
This would be used for keys that we don't want to export
to the user-interface, such as some display or touchpad keys.
Taken from GSD commit: 37806fbb00087e44dd66a19efacd5eba4441bfc9
From: Bastien Nocera <[email protected]>
Diffstat (limited to 'plugins/media-keys/msd-media-keys-manager.c')
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c index 7d4245e..0680818 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -286,6 +286,9 @@ update_kbd_cb (GSettings *settings, g_free (keys[i].key); keys[i].key = NULL; + /* We can't have a change in a hard-coded key */ + g_assert (keys[i].settings_key != NULL); + tmp = g_settings_get_string (settings, keys[i].settings_key); @@ -339,8 +342,11 @@ static void init_kbd(MsdMediaKeysManager* manager) manager); g_free (signal_name); - tmp = g_settings_get_string (manager->priv->settings, - keys[i].settings_key); + if (keys[i].settings_key != NULL) { + tmp = g_settings_get_string (manager->priv->settings, keys[i].settings_key); + } else { + tmp = g_strdup (keys[i].hard_coded); + } if (!is_valid_shortcut(tmp)) { |