summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rosca <nowrep@gmail.com>2017-01-24 12:55:29 (GMT)
committerDavid Rosca <nowrep@gmail.com>2017-01-25 09:41:40 (GMT)
commit1c9f50c88e969735cdf254c35ef700e34cc276ab (patch)
tree927a856a72a198c1dfba87fa966ffd68055bffde
parent2b87302d9d016392edc6a4842f94411612ac34b0 (diff)
VolumeSlider: Ignore all value changes until Component is completed
Mute is no longer changed on first open of popup, feedback is also no longer played in this case. BUG: 375495 FIXED-IN: 5.8.6 Differential Revision: https://phabricator.kde.org/D4269
-rw-r--r--applet/contents/ui/ListItemBase.qml9
-rw-r--r--src/kcm/package/contents/ui/VolumeSlider.qml9
2 files changed, 14 insertions, 4 deletions
diff --git a/applet/contents/ui/ListItemBase.qml b/applet/contents/ui/ListItemBase.qml
index db517c6..7dca260 100644
--- a/applet/contents/ui/ListItemBase.qml
+++ b/applet/contents/ui/ListItemBase.qml
@@ -139,7 +139,7 @@ PlasmaComponents.ListItem {
// as otherwise we can easily end up in a loop where value
// changes trigger volume changes trigger value changes.
property int volume: Volume
- property bool ignoreValueChange: false
+ property bool ignoreValueChange: true
Layout.fillWidth: true
minimumValue: PulseAudio.MinimalVolume
@@ -149,10 +149,15 @@ PlasmaComponents.ListItem {
enabled: VolumeWritable
opacity: Muted ? 0.5 : 1
+ Component.onCompleted: {
+ ignoreValueChange = false;
+ }
+
onVolumeChanged: {
+ var oldIgnoreValueChange = ignoreValueChange;
ignoreValueChange = true;
value = Volume;
- ignoreValueChange = false;
+ ignoreValueChange = oldIgnoreValueChange;
}
onValueChanged: {
diff --git a/src/kcm/package/contents/ui/VolumeSlider.qml b/src/kcm/package/contents/ui/VolumeSlider.qml
index 19bc498..e745360 100644
--- a/src/kcm/package/contents/ui/VolumeSlider.qml
+++ b/src/kcm/package/contents/ui/VolumeSlider.qml
@@ -35,7 +35,7 @@ RowLayout {
// as otherwise we can easily end up in a loop where value
// changes trigger volume changes trigger value changes.
property int volume: Volume
- property bool ignoreValueChange: false
+ property bool ignoreValueChange: true
Layout.fillWidth: true
minimumValue: PulseAudio.MinimalVolume
@@ -44,10 +44,15 @@ RowLayout {
enabled: VolumeWritable
opacity: Muted ? 0.5 : 1
+ Component.onCompleted: {
+ ignoreValueChange = false;
+ }
+
onVolumeChanged: {
+ var oldIgnoreValueChange = ignoreValueChange;
ignoreValueChange = true;
value = Volume;
- ignoreValueChange = false;
+ ignoreValueChange = oldIgnoreValueChange;
}
onValueChanged: {