1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

wallpaper: more resilience to updatesEnabled missing expose/update

events
This commit is contained in:
bbedward
2026-07-06 15:57:19 -04:00
parent 405ea708b3
commit 3e481a566b
5 changed files with 208 additions and 147 deletions
+53 -5
View File
@@ -141,16 +141,37 @@ Variants {
function invalidate() {
_settleFrames = 3;
backingWindow?.update();
if (!_wedgeBounced)
wedgeWatchdog.restart();
}
onRenderActiveChanged: invalidate()
onBackingWindowChanged: invalidate()
// No swap after a requested frame: dropped frame callback left the window
// unexposed (qtwayland mFrameCallbackTimedOut); only surface re-attach recovers.
property bool _wedgeBounced: false
Timer {
id: wedgeWatchdog
interval: 3000
repeat: false
onTriggered: {
if (!root.backingWindow || !wallpaperWindow.visible || IdleService.isShellLocked)
return;
log.warn("no frame swapped on", modelData.name, "since last invalidate, re-attaching surface");
root._wedgeBounced = true;
surfaceReattach.restart();
}
}
Connections {
target: root.backingWindow
function onFrameSwapped() {
if (root._settleFrames > 0)
root._settleFrames--;
root._wedgeBounced = false;
wedgeWatchdog.stop();
}
function onVisibleChanged() {
root.invalidate();
@@ -176,10 +197,29 @@ Variants {
function onWallpaperFillModeChanged() {
root.invalidate();
}
function onWallpaperBackgroundColorModeChanged() {
function onEffectiveWallpaperBackgroundColorChanged() {
root.invalidate();
}
function onWallpaperBackgroundCustomColorChanged() {
}
Connections {
target: SessionData
function onMonitorWallpaperFillModesChanged() {
root.invalidate();
}
function onPerMonitorWallpaperChanged() {
root.invalidate();
}
}
// Theme changes repaint DankBackdrop but nothing else wakes the render loop
Connections {
target: Theme
enabled: root.isColorSource || currentWallpaper.status === Image.Error
function onPrimaryChanged() {
root.invalidate();
}
function onBackgroundChanged() {
root.invalidate();
}
}
@@ -502,13 +542,13 @@ Variants {
}
onSourceChanged: {
invalidate();
if (!source || source.startsWith("#")) {
setWallpaperImmediate("");
return;
}
root.changePending = true;
invalidate();
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
@@ -528,10 +568,14 @@ Variants {
}
function setWallpaperImmediate(newSource) {
transitionDelayTimer.stop();
transitionAnimation.stop();
root.transitionProgress = 0.0;
root.effectActive = false;
root.screenScale = CompositorService.getScreenScale(modelData);
// No status change coming to clear the flag
if (!newSource || currentWallpaper.source.toString() === newSource)
root.changePending = false;
currentWallpaper.source = newSource;
nextWallpaper.source = "";
@@ -567,10 +611,14 @@ Variants {
}
function changeWallpaper(newPath, force) {
if (!force && newPath === currentWallpaper.source)
if (!force && newPath === currentWallpaper.source.toString()) {
root.changePending = false;
return;
if (!newPath || newPath.startsWith("#"))
}
if (!newPath || newPath.startsWith("#")) {
root.changePending = false;
return;
}
root.screenScale = CompositorService.getScreenScale(modelData);
if (root.transitioning || root.effectActive) {
root.pendingWallpaper = newPath;