diff options
Diffstat (limited to 'plugins/media-keys')
-rw-r--r-- | plugins/media-keys/acme.h | 39 | ||||
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 10 |
2 files changed, 28 insertions, 21 deletions
diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h index 17ce1ed..e7fddf7 100644 --- a/plugins/media-keys/acme.h +++ b/plugins/media-keys/acme.h @@ -54,27 +54,28 @@ enum { static struct { int key_type; const char *settings_key; + const char *hard_coded; Key *key; } keys[HANDLED_KEYS] = { - { TOUCHPAD_KEY, "touchpad", NULL }, - { MUTE_KEY, "volume-mute",NULL }, - { VOLUME_DOWN_KEY, "volume-down", NULL }, - { VOLUME_UP_KEY, "volume-up", NULL }, - { POWER_KEY, "power", NULL }, - { EJECT_KEY, "eject", NULL }, - { HOME_KEY, "home", NULL }, - { MEDIA_KEY, "media", NULL }, - { CALCULATOR_KEY, "calculator", NULL }, - { SEARCH_KEY, "search", NULL }, - { EMAIL_KEY, "email", NULL }, - { SCREENSAVER_KEY, "screensaver", NULL }, - { HELP_KEY, "help", NULL }, - { WWW_KEY, "www", NULL }, - { PLAY_KEY, "play", NULL }, - { PAUSE_KEY, "pause", NULL }, - { STOP_KEY, "stop", NULL }, - { PREVIOUS_KEY, "previous", NULL }, - { NEXT_KEY, "next", NULL }, + { TOUCHPAD_KEY, "touchpad", NULL, NULL }, + { MUTE_KEY, "volume-mute", NULL, NULL }, + { VOLUME_DOWN_KEY, "volume-down", NULL, NULL }, + { VOLUME_UP_KEY, "volume-up", NULL, NULL }, + { POWER_KEY, "power", NULL, NULL }, + { EJECT_KEY, "eject", NULL, NULL }, + { HOME_KEY, "home", NULL, NULL }, + { MEDIA_KEY, "media", NULL, NULL }, + { CALCULATOR_KEY, "calculator", NULL, NULL }, + { SEARCH_KEY, "search", NULL, NULL }, + { EMAIL_KEY, "email", NULL, NULL }, + { SCREENSAVER_KEY, "screensaver", NULL, NULL }, + { HELP_KEY, "help", NULL, NULL }, + { WWW_KEY, "www", NULL, NULL }, + { PLAY_KEY, "play", NULL, NULL }, + { PAUSE_KEY, "pause", NULL, NULL }, + { STOP_KEY, "stop", NULL, NULL }, + { PREVIOUS_KEY, "previous", NULL, NULL }, + { NEXT_KEY, "next", NULL, NULL }, { MAGNIFIER_KEY, "magnifier", NULL, NULL }, { SCREENREADER_KEY, "screenreader", NULL, NULL }, { ON_SCREEN_KEYBOARD_KEY, "on-screen-keyboard", NULL, NULL }, 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)) { |