mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 09:14:01 -04:00
fix(power): reconcile refresh rate after resume (#3459)
(cherry picked from commit 8fedfae1dc)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user