From 0adbdfdde10b57f4dc8a93f61edbba0218d5f343 Mon Sep 17 00:00:00 2001 From: Artem Timofeev <39891735+atimofeev@users.noreply.github.com> Date: Wed, 7 Oct 2026 17:17:12 +0200 Subject: [PATCH] fix(power): reconcile refresh rate after resume (#3459) (cherry picked from commit 8fedfae1dc99d638080d907bcc51965cc45ba9d0) --- quickshell/Services/DisplayService.qml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/quickshell/Services/DisplayService.qml b/quickshell/Services/DisplayService.qml index d31e75b57..fcd03af7c 100644 --- a/quickshell/Services/DisplayService.qml +++ b/quickshell/Services/DisplayService.qml @@ -63,6 +63,26 @@ Singleton { onTriggered: root.requestSync("startup") } + property int powerSyncRecoveryAttempt: 0 + readonly property var powerSyncRecoveryIntervals: [1000, 5000, 15000, 30000] + + Timer { + id: powerSyncRecoveryTimer + interval: root.powerSyncRecoveryIntervals[0] + repeat: false + onTriggered: { + root.requestSync("resume-reconcile"); + root.powerSyncRecoveryAttempt++; + if (root.powerSyncRecoveryAttempt < root.powerSyncRecoveryIntervals.length) { + interval = root.powerSyncRecoveryIntervals[root.powerSyncRecoveryAttempt]; + restart(); + return; + } + root.powerSyncRecoveryAttempt = 0; + interval = root.powerSyncRecoveryIntervals[0]; + } + } + signal brightnessChanged(bool showOsd) signal deviceSwitched @@ -1541,6 +1561,9 @@ Singleton { resumeRecoveryAttempt = 0; resumeRecoveryTimer.interval = 400; resumeRecoveryTimer.restart(); + powerSyncRecoveryAttempt = 0; + powerSyncRecoveryTimer.interval = powerSyncRecoveryIntervals[0]; + powerSyncRecoveryTimer.restart(); } }