v0.20.6: one press, sixteen hundred songs

A single Right-arrow press skipped 1,676 tracks in 81 s and hard-froze the
desktop. On Wayland key repeat is generated by the client until the
compositor delivers the release, and the key filter treated every repeat as
a new press. Each skip sent gnome-shell an MPRIS Metadata whose xesam:artist
was a plain Python list, which marshals as "av" instead of "as". gnome-shell
logged an error for every one (50k/min) and reloaded the cover, and that load
is what kept it from ever delivering the release.

Space/Left/Right now act once per press and swallow the repeats.
xesam:artist goes out through mpris.string_array, which build_properties_changed
now shares for invalidated_properties. The new test round-trips the signal
into GDBus, which is what gnome-shell validates with, and fails 'av' == 'as'
against the old code.
This commit is contained in:
2026-09-17 21:52:45 -07:00
parent 4afd43b5d6
commit 10cf636c23
6 changed files with 186 additions and 8 deletions
+9
View File
@@ -1626,6 +1626,15 @@ class MainWindow(QMainWindow):
QAbstractSpinBox, QComboBox)):
return False
key = event.key()
if key in (Qt.Key.Key_Space, Qt.Key.Key_Right, Qt.Key.Key_Left) \
and event.isAutoRepeat():
# On Wayland key repeat is generated client-side until the
# compositor delivers the release — and a compositor busy
# with our own MPRIS churn delivers it late, so one held
# arrow became 1,676 track skips (Round 56). A transport key
# acts once per press; the repeats are swallowed so they
# don't fall through and move the table's cursor either.
return True
if key == Qt.Key.Key_Space:
self._log_key(event, "space")
self.play_pause()