Public bug reported:
Description
A state desynchronization occurs in the Quick Settings volume slider. If a user
adjusts the volume using the mouse wheel, then modifies the volume using
hardware media keys, subsequent mouse scrolling causes the slider to jump back
to the previously cached scroll state, ignoring the intermediate hardware key
adjustments.
Steps to Reproduce
Open the Quick Settings menu.
Hover over the volume slider and scroll the mouse wheel to set a high volume
level.
Without touching the mouse, use the keyboard's hardware media keys to
significantly decrease the volume.
Hover over the volume slider again and scroll the mouse wheel down to decrease
the volume further.
Expected behavior: Volume decreases smoothly starting from the new, lower level
set by the media keys.
Actual behavior: Volume unexpectedly spikes back up to the high level set in
Step 2, and starts decreasing from there.
Root Cause Analysis
The issue originates in js/ui/slider.js. The Slider class uses the
this._unsnappedValue property to track the base value for delta applications
inside the _applyDelta(delta) method. This mechanism correctly prevents the
slider from getting stuck at snap marks when the scroll step is smaller than
the snap threshold.
However, when hardware keys adjust the volume, the system changes this.value
externally via the settings daemon. During this external update,
this._unsnappedValue is never invalidated. On the next scroll event,
_applyDelta(delta) initializes its base calculation using the stale
this._unsnappedValue instead of the current this._value. This causes the slider
to instantly revert to the old cached state.
Proposed Fix
Introduce a state invalidation mechanism inside the _init() method of the
Slider class. By connecting to the notify::value signal, the class can detect
external modifications and clear this._unsnappedValue accordingly.
$ cat gnome-shell-50.1/debian/patches/99-fix-volume-slider-desync.patch
Index: gnome-shell-50.1/js/ui/slider.js
===================================================================
--- gnome-shell-50.1.orig/js/ui/slider.js
+++ gnome-shell-50.1/js/ui/slider.js
@@ -39,6 +39,17 @@ export const Slider = GObject.registerCl
this._marks = new Set();
this._unsnappedValue = null;
+
+ // Proposed Fix: Invalidate stale unsnapped state on external value
change
+ this.connect('notify::value', () => {
+ if (this._unsnappedValue !== null) {
+ const expectedValue = this._snapToMark(this._unsnappedValue);
+ // Use a small epsilon to account for floating-point
inaccuracies
+ if (Math.abs(this._value - expectedValue) > 0.0001) {
+ this._unsnappedValue = null;
+ }
+ }
+ });
}
addMark(value) {
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: gnome-shell 50.1-0ubuntu1
ProcVersionSignature: Ubuntu 7.0.0-22.22-generic 7.0.0
Uname: Linux 7.0.0-22-generic x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Jun 13 13:48:12 2026
DisplayManager: gdm3
InstallationDate: Installed on 2024-08-19 (663 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
ProcEnviron:
LANG=ru_RU.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-256color
XDG_RUNTIME_DIR=<set>
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions: mutter-common 50.1-0ubuntu2.2
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to resolute on 2026-06-06 (7 days ago)
** Affects: gnome-shell (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug resolute wayland-session
--
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-shell in Ubuntu.
https://bugs.launchpad.net/bugs/2156651
Title:
Volume slider jumps to stale value when mixing mouse scroll and media
keys
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2156651/+subscriptions
--
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs