Skip to content

Commit

Permalink
Tweak timing/logging for new events
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Oct 2, 2024
1 parent 0c7cdd7 commit 680c408
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -2464,13 +2464,19 @@ function createPanel(toggleOnLoad = false, isRefreshing = false) {
if(setting.data === 2) {
// Idle
if(!isWindowsUserIdle) {
console.log("Displays have gone to sleep.")

// If we were about to do a hardware event, stop.
if (handleChangeTimeout1) clearTimeout(handleChangeTimeout1);
if (handleChangeTimeout2) clearTimeout(handleChangeTimeout2);
//if(!isUserIdle) startIdleCheckShort();
}
isWindowsUserIdle = true
} else if(setting.data === 0) {
// Active
if(isWindowsUserIdle) {
handleMonitorChange("GUID_SESSION_USER_PRESENCE")
console.log("Displays have woken up.")
handleMetricsChange("GUID_SESSION_USER_PRESENCE")
}
isWindowsUserIdle = false
}
Expand Down Expand Up @@ -3777,11 +3783,11 @@ function handleMetricsChange(type) {
handleBackgroundUpdate(true) // Apply Time Of Day Adjustments

handleChangeTimeout1 = false
}, parseInt(settings.idleRestoreSeconds || 2) * 1000)
}, parseInt(settings.idleRestoreSeconds || 3) * 1000)

setTimeout(() => {
block.release()
}, parseInt(settings.idleRestoreSeconds || 2) * 1000)
}, parseInt(settings.idleRestoreSeconds || 3) * 1000)
}


Expand Down

0 comments on commit 680c408

Please sign in to comment.