-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(screen): multiple small fixes in screen module behavior. #273
Conversation
@@ -7,7 +7,7 @@ static void receive_waiting_state(const msg_t *msg, UNUSED const void *userdata) | |||
static int parse_bus_reply(sd_bus_message *reply, const char *member, void *userdata); | |||
static int get_screen_brightness(void); | |||
static void timeout_callback(int old_val, bool reset); | |||
static void pause_screen(bool pause, enum mod_pause type); | |||
static void pause_screen(bool pause, enum mod_pause type, bool reset_screen_br); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enforce the state.screen_br
resetting when needed, even if screen was already paused.
Fix issues like:
- system going to sleep -> previous code skipped resetting screen br
- while system is sleeping, AC cable is disconnected -> since screen is already paused, screen_br is not resetted
get_screen_brightness(); | ||
pause_screen(state.ambient_br < conf.bl_conf.shutter_threshold, CLOGGED, false); | ||
if (!paused_state) { | ||
get_screen_brightness(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to get screen brightness if we are paused/clogged.
@@ -101,18 +103,18 @@ static void receive(const msg_t *msg, UNUSED const void *userdata) { | |||
break; | |||
} | |||
case DISPLAY_UPD: | |||
pause_screen(state.display_state, DISPLAY); | |||
pause_screen(state.display_state, DISPLAY, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset screen_br on display upd (ie: dimming/dpms).
break; | ||
case LID_UPD: | ||
if (conf.bl_conf.pause_on_lid_closed) { | ||
pause_screen(state.lid_state, LID); | ||
pause_screen(state.lid_state, LID, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset screen_br on lid closed.
} | ||
break; | ||
case SUSPEND_UPD: | ||
pause_screen(state.suspended, SUSPEND); | ||
pause_screen(state.suspended, SUSPEND, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset screen_br on system suspend.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
7580d52
to
0344540
Compare
No description provided.