don't apply offset when screen is off

This commit is contained in:
Alessandro Mauri 2024-10-22 16:00:06 +02:00
parent bee1f35542
commit 550fa7f18b

View file

@ -165,9 +165,14 @@ int main (void)
actual_brightness = brightness_adjusted;
}
// if the actual brightness is zero, it means that the screen is turned
// off for some reason, usually DPMS. As such it should not count for user
// offset. Look at the TODO file.
if (actual_brightness != 0) {
off = actual_brightness - brightness_target;
if (brightness_target != max_brightness || off < 0){
user_offset = off;
if (brightness_target != max_brightness || off < 0){
user_offset = off;
}
}
// TODO: option to turn off logging