From 5d483e6284dcb2b3e7b724acd762e7103deee0f6 Mon Sep 17 00:00:00 2001 From: Damocles Date: Sun, 12 Apr 2026 18:39:15 +0200 Subject: [PATCH 1/2] fix mpris album art: keep visible after temp file deletion --- modules/Mpris.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/Mpris.qml b/modules/Mpris.qml index 7d1b299..e8147e5 100644 --- a/modules/Mpris.qml +++ b/modules/Mpris.qml @@ -140,7 +140,7 @@ M.BarSection { // Album art Item { width: parent.width - height: _artImg.status === Image.Ready ? 140 : 60 + height: _artImg._hasArt ? 140 : 60 clip: true Rectangle { @@ -152,15 +152,17 @@ M.BarSection { id: _artImg anchors.fill: parent fillMode: Image.PreserveAspectCrop - visible: status === Image.Ready + visible: _hasArt asynchronous: true + property bool _hasArt: false property string _lastGoodSource: "" property string _lastTrack: "" readonly property string _artUrl: root.player?.trackArtUrl ?? "" readonly property string _track: root.player?.trackTitle ?? "" on_ArtUrlChanged: if (_artUrl) _lastGoodSource = _artUrl - on_TrackChanged: if (_track !== _lastTrack) { _lastTrack = _track; _lastGoodSource = _artUrl || "" } + on_TrackChanged: if (_track !== _lastTrack) { _lastTrack = _track; _lastGoodSource = _artUrl || ""; _hasArt = false } + onStatusChanged: if (status === Image.Ready) _hasArt = true source: _lastGoodSource } From 7e359fb7308c08dec9365871a7029b1eee620e33 Mon Sep 17 00:00:00 2001 From: Damocles Date: Sun, 12 Apr 2026 18:42:06 +0200 Subject: [PATCH 2/2] mpris: preload album art at root level, cache survives panel hidden --- modules/Mpris.qml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/Mpris.qml b/modules/Mpris.qml index e8147e5..17f7c7f 100644 --- a/modules/Mpris.qml +++ b/modules/Mpris.qml @@ -13,6 +13,21 @@ M.BarSection { readonly property MprisPlayer player: Mpris.players.values[0] ?? null readonly property bool playing: player?.playbackState === MprisPlaybackState.Playing + property string _cachedArt: "" + property string _artTrack: "" + + // Cache art URL at root level so it's captured even when panel is hidden + readonly property string _artUrl: player?.trackArtUrl ?? "" + readonly property string _currentTrack: player?.trackTitle ?? "" + on_ArtUrlChanged: if (_artUrl) _cachedArt = _artUrl + on_CurrentTrackChanged: if (_currentTrack !== _artTrack) { _artTrack = _currentTrack; _cachedArt = _artUrl || "" } + + // Preload art while panel is hidden — ensures QML image cache has the pixels + Image { + visible: false + source: root._cachedArt + asynchronous: true + } required property var bar @@ -154,16 +169,14 @@ M.BarSection { fillMode: Image.PreserveAspectCrop visible: _hasArt asynchronous: true + source: root._cachedArt property bool _hasArt: false - property string _lastGoodSource: "" - property string _lastTrack: "" - readonly property string _artUrl: root.player?.trackArtUrl ?? "" - readonly property string _track: root.player?.trackTitle ?? "" - on_ArtUrlChanged: if (_artUrl) _lastGoodSource = _artUrl - on_TrackChanged: if (_track !== _lastTrack) { _lastTrack = _track; _lastGoodSource = _artUrl || ""; _hasArt = false } onStatusChanged: if (status === Image.Ready) _hasArt = true - source: _lastGoodSource + Connections { + target: root + function on_CachedArtChanged() { if (!root._cachedArt) _artImg._hasArt = false } + } } Rectangle {