From 8d77122da3e7af610d7288e11c04db4fa501cdcf Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 24 Feb 2026 13:16:05 -0500 Subject: [PATCH] widgets: set updatesEnabled false on background layers, if qs supports it --- .../Modules/BlurredWallpaperBackground.qml | 30 +++++++++++++++++++ quickshell/Modules/WallpaperBackground.qml | 30 +++++++++++++++++++ quickshell/Widgets/DankPopout.qml | 4 +++ 3 files changed, 64 insertions(+) diff --git a/quickshell/Modules/BlurredWallpaperBackground.qml b/quickshell/Modules/BlurredWallpaperBackground.qml index 6b58baee..60380c60 100644 --- a/quickshell/Modules/BlurredWallpaperBackground.qml +++ b/quickshell/Modules/BlurredWallpaperBackground.qml @@ -87,19 +87,47 @@ Variants { Component.onCompleted: { if (!source) { isInitialized = true; + updatesBindingTimer.start(); return; } const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source); setWallpaperImmediate(formattedSource); isInitialized = true; + updatesBindingTimer.start(); } property bool isInitialized: false property real transitionProgress: 0 readonly property bool transitioning: transitionAnimation.running property bool effectActive: false + property bool _renderSettling: false property bool useNextForEffect: false + Connections { + target: currentWallpaper + function onStatusChanged() { + if (currentWallpaper.status === Image.Ready) { + root._renderSettling = true; + renderSettleTimer.restart(); + } + } + } + + Timer { + id: renderSettleTimer + interval: 100 + onTriggered: root._renderSettling = false + } + + Timer { + id: updatesBindingTimer + interval: 500 + onTriggered: { + if (typeof blurWallpaperWindow.updatesEnabled !== "undefined") + blurWallpaperWindow.updatesEnabled = Qt.binding(() => root.effectActive || root._renderSettling || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading); + } + } + onSourceChanged: { if (!source || source.startsWith("#")) { setWallpaperImmediate(""); @@ -124,6 +152,8 @@ Variants { transitionAnimation.stop(); root.transitionProgress = 0.0; root.effectActive = false; + root._renderSettling = true; + renderSettleTimer.restart(); currentWallpaper.source = newSource; nextWallpaper.source = ""; } diff --git a/quickshell/Modules/WallpaperBackground.qml b/quickshell/Modules/WallpaperBackground.qml index 46dd3070..714da9a4 100644 --- a/quickshell/Modules/WallpaperBackground.qml +++ b/quickshell/Modules/WallpaperBackground.qml @@ -83,9 +83,35 @@ Variants { readonly property bool transitioning: transitionAnimation.running property bool effectActive: false + property bool _renderSettling: false property bool useNextForEffect: false property string pendingWallpaper: "" + Connections { + target: currentWallpaper + function onStatusChanged() { + if (currentWallpaper.status === Image.Ready) { + root._renderSettling = true; + renderSettleTimer.restart(); + } + } + } + + Timer { + id: renderSettleTimer + interval: 100 + onTriggered: root._renderSettling = false + } + + Timer { + id: updatesBindingTimer + interval: 500 + onTriggered: { + if (typeof wallpaperWindow.updatesEnabled !== "undefined") + wallpaperWindow.updatesEnabled = Qt.binding(() => root.effectActive || root._renderSettling || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading); + } + } + function getFillMode(modeName) { switch (modeName) { case "Stretch": @@ -112,11 +138,13 @@ Variants { Component.onCompleted: { if (!source) { isInitialized = true; + updatesBindingTimer.start(); return; } const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source); setWallpaperImmediate(formattedSource); isInitialized = true; + updatesBindingTimer.start(); } onSourceChanged: { @@ -143,6 +171,8 @@ Variants { transitionAnimation.stop(); root.transitionProgress = 0.0; root.effectActive = false; + root._renderSettling = true; + renderSettleTimer.restart(); currentWallpaper.source = newSource; nextWallpaper.source = ""; } diff --git a/quickshell/Widgets/DankPopout.qml b/quickshell/Widgets/DankPopout.qml index 0aae5cb2..ac05df83 100644 --- a/quickshell/Widgets/DankPopout.qml +++ b/quickshell/Widgets/DankPopout.qml @@ -288,6 +288,10 @@ Item { screen: root.screen visible: false color: "transparent" + Component.onCompleted: { + if (typeof updatesEnabled !== "undefined") + updatesEnabled = false; + } WlrLayershell.namespace: root.layerNamespace + ":background" WlrLayershell.layer: WlrLayershell.Top