1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

widgets: set updatesEnabled false on background layers, if qs supports

it
This commit is contained in:
bbedward
2026-02-24 13:16:05 -05:00
parent fb66effa51
commit 8d77122da3
3 changed files with 64 additions and 0 deletions

View File

@@ -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 = "";
}

View File

@@ -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 = "";
}

View File

@@ -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