summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgm10 <[email protected]>2019-07-27 11:23:47 +0200
committerraveit65 <[email protected]>2019-07-27 16:06:03 +0200
commit962c75b3cf9d301227d7f584fa913ef21f28bd78 (patch)
tree7d9a47ed60e2f4af09011eab67d64700bd82d57f
parentf7eb962919d338d2b64efb197eeb997ecf5770a2 (diff)
downloadmate-settings-daemon-962c75b3cf9d301227d7f584fa913ef21f28bd78.tar.bz2
mate-settings-daemon-962c75b3cf9d301227d7f584fa913ef21f28bd78.tar.xz
Change media-keys volume-step default from 6 to 5 in the gschema and use only that instead of a redundant constant in the code.
-rw-r--r--data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in2
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in
index 9677b6a..866fbf7 100644
--- a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in
+++ b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in
@@ -16,7 +16,7 @@
<description>Priority to use for this plugin in mate-settings-daemon startup queue</description>
</key>
<key name="volume-step" type="i">
- <default>6</default>
+ <default>5</default>
<summary>Volume step</summary>
<description>Volume step as percentage of volume.</description>
</key>
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index a68835f..b1fe2dc 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -58,8 +58,6 @@
#define TOUCHPAD_SCHEMA "org.mate.peripherals-touchpad"
#define TOUCHPAD_ENABLED_KEY "touchpad-enabled"
-#define VOLUME_STEP 6
-
#define MSD_MEDIA_KEYS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MSD_TYPE_MEDIA_KEYS_MANAGER, MsdMediaKeysManagerPrivate))
typedef struct {
@@ -732,9 +730,11 @@ do_sound_action (MsdMediaKeysManager *manager,
volume_max = mate_mixer_stream_control_get_normal_volume (control);
volume_step = g_settings_get_int (manager->priv->settings, "volume-step");
- if (volume_step <= 0 ||
- volume_step > 100)
- volume_step = VOLUME_STEP;
+ if (volume_step <= 0 || volume_step > 100) {
+ GVariant *variant = g_settings_get_default_value (manager->priv->settings, "volume-step");
+ volume_step = g_variant_get_int32 (variant);
+ g_variant_unref (variant);
+ }
/* Scale the volume step size accordingly to the range used by the control */
volume_step = (volume_max - volume_min) * volume_step / 100;