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

wallpaper: tweak binding again for updatesEnabled

This commit is contained in:
bbedward
2026-03-20 09:22:27 -04:00
parent 347f06b758
commit cbf00d133a
2 changed files with 43 additions and 10 deletions

View File

@@ -100,10 +100,10 @@ Variants {
Connections { Connections {
target: currentWallpaper target: currentWallpaper
function onStatusChanged() { function onStatusChanged() {
if (currentWallpaper.status === Image.Ready) { if (currentWallpaper.status !== Image.Ready && currentWallpaper.status !== Image.Error)
root._renderSettling = true; return;
renderSettleTimer.restart(); root._renderSettling = true;
} renderSettleTimer.restart();
} }
} }
@@ -206,6 +206,7 @@ Variants {
visible: false visible: false
opacity: 1 opacity: 1
asynchronous: true asynchronous: true
retainWhileLoading: true
smooth: true smooth: true
cache: true cache: true
sourceSize: Qt.size(root.textureWidth, root.textureHeight) sourceSize: Qt.size(root.textureWidth, root.textureHeight)
@@ -218,6 +219,7 @@ Variants {
visible: false visible: false
opacity: 0 opacity: 0
asynchronous: true asynchronous: true
retainWhileLoading: true
smooth: true smooth: true
cache: true cache: true
sourceSize: Qt.size(root.textureWidth, root.textureHeight) sourceSize: Qt.size(root.textureWidth, root.textureHeight)
@@ -300,6 +302,8 @@ Variants {
root.useNextForEffect = false; root.useNextForEffect = false;
nextWallpaper.source = ""; nextWallpaper.source = "";
root.transitionProgress = 0.0; root.transitionProgress = 0.0;
root._renderSettling = true;
renderSettleTimer.restart();
root.effectActive = false; root.effectActive = false;
} }
} }

View File

@@ -84,17 +84,19 @@ Variants {
readonly property bool transitioning: transitionAnimation.running readonly property bool transitioning: transitionAnimation.running
property bool effectActive: false property bool effectActive: false
property bool _renderSettling: true property bool _renderSettling: true
property bool _overviewBlurSettling: false
property bool useNextForEffect: false property bool useNextForEffect: false
property string pendingWallpaper: "" property string pendingWallpaper: ""
property string _deferredSource: "" property string _deferredSource: ""
readonly property bool overviewBlurActive: CompositorService.isNiri && SettingsData.blurWallpaperOnOverview && NiriService.inOverview && currentWallpaper.source !== ""
Connections { Connections {
target: currentWallpaper target: currentWallpaper
function onStatusChanged() { function onStatusChanged() {
if (currentWallpaper.status === Image.Ready) { if (currentWallpaper.status !== Image.Ready && currentWallpaper.status !== Image.Error)
root._renderSettling = true; return;
renderSettleTimer.restart(); root._renderSettling = true;
} renderSettleTimer.restart();
} }
} }
@@ -120,6 +122,22 @@ Variants {
} }
} }
Connections {
target: NiriService
function onInOverviewChanged() {
root._overviewBlurSettling = true;
overviewBlurSettleTimer.restart();
}
}
Connections {
target: SettingsData
function onBlurWallpaperOnOverviewChanged() {
root._overviewBlurSettling = true;
overviewBlurSettleTimer.restart();
}
}
Connections { Connections {
target: CompositorService target: CompositorService
function onRandrDataReady() { function onRandrDataReady() {
@@ -139,6 +157,12 @@ Variants {
onTriggered: root._renderSettling = false onTriggered: root._renderSettling = false
} }
Timer {
id: overviewBlurSettleTimer
interval: 150
onTriggered: root._overviewBlurSettling = false
}
function getFillMode(modeName) { function getFillMode(modeName) {
switch (modeName) { switch (modeName) {
case "Stretch": case "Stretch":
@@ -164,7 +188,7 @@ Variants {
Component.onCompleted: { Component.onCompleted: {
if (typeof wallpaperWindow.updatesEnabled !== "undefined") if (typeof wallpaperWindow.updatesEnabled !== "undefined")
wallpaperWindow.updatesEnabled = Qt.binding(() => !root.source || root.effectActive || root._renderSettling || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading); wallpaperWindow.updatesEnabled = Qt.binding(() => !root.source || root.effectActive || root._renderSettling || root.overviewBlurActive || root._overviewBlurSettling || root.pendingWallpaper !== "" || root._deferredSource !== "" || currentWallpaper.status === Image.Loading || nextWallpaper.status === Image.Loading);
if (!source) { if (!source) {
root._renderSettling = false; root._renderSettling = false;
@@ -296,6 +320,7 @@ Variants {
opacity: 1 opacity: 1
layer.enabled: false layer.enabled: false
asynchronous: true asynchronous: true
retainWhileLoading: true
smooth: true smooth: true
cache: true cache: true
sourceSize: Qt.size(root.textureWidth, root.textureHeight) sourceSize: Qt.size(root.textureWidth, root.textureHeight)
@@ -309,6 +334,7 @@ Variants {
opacity: 0 opacity: 0
layer.enabled: false layer.enabled: false
asynchronous: true asynchronous: true
retainWhileLoading: true
smooth: true smooth: true
cache: true cache: true
sourceSize: Qt.size(root.textureWidth, root.textureHeight) sourceSize: Qt.size(root.textureWidth, root.textureHeight)
@@ -567,6 +593,8 @@ Variants {
root.transitionProgress = 0.0; root.transitionProgress = 0.0;
currentWallpaper.layer.enabled = false; currentWallpaper.layer.enabled = false;
nextWallpaper.layer.enabled = false; nextWallpaper.layer.enabled = false;
root._renderSettling = true;
renderSettleTimer.restart();
root.effectActive = false; root.effectActive = false;
if (!root.pendingWallpaper) if (!root.pendingWallpaper)
@@ -578,8 +606,9 @@ Variants {
} }
Loader { Loader {
id: overviewBlurLoader
anchors.fill: parent anchors.fill: parent
active: CompositorService.isNiri && SettingsData.blurWallpaperOnOverview && NiriService.inOverview && currentWallpaper.source !== "" active: root.overviewBlurActive
sourceComponent: MultiEffect { sourceComponent: MultiEffect {
anchors.fill: parent anchors.fill: parent