Skip to content

Commit

Permalink
Don't set brightness if displays are likely off
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Oct 7, 2024
1 parent 4d4159e commit d66c39f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,7 @@ function updateBrightnessThrottle(id, level, useCap = true, sendUpdate = true, v
let ignoreBrightnessEvent = false
let ignoreBrightnessEventTimeout = false
function updateBrightness(index, newLevel, useCap = true, vcpValue = "brightness", clearTransition = true) {
if(isWindowsUserIdle) return false; // Skip if displays are off
try {
let level = newLevel
let vcp = "brightness"
Expand Down Expand Up @@ -2487,10 +2488,10 @@ function createPanel(toggleOnLoad = false, isRefreshing = false) {
} else if(setting.data === 0) {
// Active
if(isWindowsUserIdle) {
isWindowsUserIdle = false
console.log("Displays have woken up.")
handleMetricsChange("GUID_SESSION_USER_PRESENCE")
}
isWindowsUserIdle = false
}
} else if(setting.name === "GUID_VIDEO_POWERDOWN_TIMEOUT") {
// "Turn off my screen after"
Expand Down

0 comments on commit d66c39f

Please sign in to comment.