don't apply offset when screen is off
This commit is contained in:
parent
bee1f35542
commit
550fa7f18b
1 changed files with 7 additions and 2 deletions
|
|
@ -165,10 +165,15 @@ int main (void)
|
||||||
actual_brightness = brightness_adjusted;
|
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;
|
off = actual_brightness - brightness_target;
|
||||||
if (brightness_target != max_brightness || off < 0){
|
if (brightness_target != max_brightness || off < 0){
|
||||||
user_offset = off;
|
user_offset = off;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: option to turn off logging
|
// TODO: option to turn off logging
|
||||||
printf("brightness target: %d; user offset: %d; brightness adjusted: %d\n", brightness_target, user_offset, brightness_adjusted);
|
printf("brightness target: %d; user offset: %d; brightness adjusted: %d\n", brightness_target, user_offset, brightness_adjusted);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue