Skip to content

Commit

Permalink
Adjusted refresh logic on hardware change
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Nov 16, 2023
1 parent 9410203 commit 35ecf44
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -3392,21 +3392,21 @@ function handleMonitorChange(e, d) {
handleChangeTimeout0 = setTimeout(() => {
if (!settings.disableAutoApply) setKnownBrightness();
handleChangeTimeout0 = false
}, 150)
}, 500)
if (handleChangeTimeout1) {
clearTimeout(handleChangeTimeout1)
}
handleChangeTimeout1 = setTimeout(() => {
if (!settings.disableAutoApply) setKnownBrightness();
handleChangeTimeout1 = false
}, 750)
}, 1250)
if (handleChangeTimeout2) {
clearTimeout(handleChangeTimeout2)
}
handleChangeTimeout2 = setTimeout(() => {

// Reset all known displays
if (!settings.disableAutoRefresh) refreshMonitors(true, true).then(() => {
refreshMonitors(true, true).then(() => {
if (!settings.disableAutoApply) setKnownBrightness();
handleBackgroundUpdate(true) // Apply Time Of Day Adjustments

Expand All @@ -3425,7 +3425,7 @@ powerMonitor.on("resume", () => {
if (!settings.disableAutoApply) setKnownBrightness();
setTimeout(
() => {
if (!settings.disableAutoRefresh) refreshMonitors(true, true).then(() => {
if (!settings.disableAutoRefresh) refreshMonitors(true).then(() => {
if (!settings.disableAutoApply) setKnownBrightness();
//restartPanel()

Expand All @@ -3435,12 +3435,6 @@ powerMonitor.on("resume", () => {
},
parseInt(settings.wakeRestoreTime) || 3000 // Give Windows a few seconds to... you know... wake up.
)
if (!settings.disableAutoRefresh) setTimeout(() => {
refreshMonitors(true)
},
10000 // Additional full refresh
)


})

Expand Down

0 comments on commit 35ecf44

Please sign in to comment.