gsd-media-key's sync leaves keys ungrabbed after `dconf update`
There appears to be a problem in keys_sync_continue
' sync functionality. Running dconf update
causes gsd-media-keys
to ungrab and re-grab a bunch of accelerators, but when the dust settles, some are left un-grabbed, and so do not work.
Oddly, some accelerators are un-grabbed and re-grabbed multiple times. While this is not a problem per se, it's an indication that something has gone awry in gsd-media-keys-manager.c's invariants.
Example log of accelerator grab lifetimes attached, pieced together from dbus-monitor
logs and running imports.ui.main.shellDBusService._grabbedAccelerators.forEach((k, v) => global.log(k + ' = ' + v))
in lg to get the initial and final grabs. dconf update
runs at t=30.
For example, consider the grabs for XF86AudioLowerVolume:
$ grep LowerVolume grab-lifetimes-by-id.txt
1080 "<Ctrl>XF86AudioLowerVolume" 0 inf
1083 "<Alt>XF86AudioLowerVolume" 0 inf
1085 "<Shift>XF86AudioLowerVolume" 0 inf
1108 "XF86AudioLowerVolume" 0 30.5547
1181 "XF86AudioLowerVolume" 30.5563 30.6864
1227 "XF86AudioLowerVolume" 30.6869 30.7239
The grabs with a modifier are left alone, but the grab with no modifier key is released and re-grabbed twice before being release and left released, causing the XF86AudioLowerVolume key to stop working (but still work when a modifier key is pressed).
dbus-monitor logs for the no-modifier XF86AudioLowerVolume keygrab:
...(98 entries omitted)...
method call time=1581456844.654341 sender=:1.293 -> destination=:1.10 serial=154 path=/org/gnome/Shell; interface=org.gnome.Shell; member=UngrabAccelerator
uint32 1108
method call time=1581456844.654345 sender=:1.293 -> destination=:1.10 serial=155 path=/org/gnome/Shell; interface=org.gnome.Shell; member=GrabAccelerator
string "XF86AudioLowerVolume"
uint32 4294967295
uint32 0
... (326 entries omitted)...
method return time=1581456845.554723 sender=:1.10 -> destination=:1.293 serial=7402 reply_serial=154
boolean true
... (2 entries omitted)...
method return time=1581456845.556270 sender=:1.10 -> destination=:1.293 serial=7403 reply_serial=155
uint32 1181
... (1 entry omitted)...
method call time=1581456845.556593 sender=:1.293 -> destination=:1.10 serial=252 path=/org/gnome/Shell; interface=org.gnome.Shell; member=UngrabAccelerator
uint32 1181
method call time=1581456845.556612 sender=:1.293 -> destination=:1.10 serial=253 path=/org/gnome/Shell; interface=org.gnome.Shell; member=GrabAccelerator
string "XF86AudioLowerVolume"
uint32 4294967295
uint32 0
... (371 entries omitted)...
method return time=1581456845.686425 sender=:1.10 -> destination=:1.293 serial=7607 reply_serial=252
boolean true
method return time=1581456845.686872 sender=:1.10 -> destination=:1.293 serial=7608 reply_serial=253
uint32 1227
method call time=1581456845.686892 sender=:1.293 -> destination=:1.10 serial=316 path=/org/gnome/Shell; interface=org.gnome.Shell; member=UngrabAccelerator
uint32 1227
... (65 entries omitted)...
method return time=1581456845.723860 sender=:1.10 -> destination=:1.293 serial=7672 reply_serial=316
boolean true
... (68 entries omitted)...
Version: 3.32.2
successful-grab-lifetimes-by-accelerator.txt