Turn off screen and backlight on state change only.
This commit is contained in:
1 parent
c771e2d2e6
commit
c47f7668df
1 file changed
+14
-8
@@ -734,7 +734,8 @@ readpw(struct arena *arena,
|
||||
{
|
||||
XRRScreenChangeNotifyEvent *rre;
|
||||
char buf[32], passwd[256], *inputhash;
|
||||
int num, screen, running, failure, locked, oldc, i, passing, dson, tfd, xfd;
|
||||
int num, screen, running, failure, locked, oldc, i, passing,
|
||||
dson, dson_saved, tfd, xfd;
|
||||
unsigned int len, color;
|
||||
struct timeval tv;
|
||||
KeySym ksym;
|
||||
@@ -751,7 +752,9 @@ readpw(struct arena *arena,
|
||||
failure = 0;
|
||||
locked = 1;
|
||||
oldc = INIT;
|
||||
dson = 1;
|
||||
|
||||
dson = 1;
|
||||
dson_saved = 1;
|
||||
|
||||
xfd = ConnectionNumber(dpy);
|
||||
tfd = timerfd_create(CLOCK_REALTIME, 0);
|
||||
@@ -905,13 +908,16 @@ readpw(struct arena *arena,
|
||||
}
|
||||
}
|
||||
|
||||
if(dson) {
|
||||
reset_keyboard_backlight(bl_state);
|
||||
set_screen_on(dpy);
|
||||
} else {
|
||||
set_keyboard_backlight_off(bl_state);
|
||||
set_screen_off(dpy);
|
||||
if(dson_saved != dson) {
|
||||
if(dson) {
|
||||
reset_keyboard_backlight(bl_state);
|
||||
set_screen_on(dpy);
|
||||
} else {
|
||||
set_keyboard_backlight_off(bl_state);
|
||||
set_screen_off(dpy);
|
||||
}
|
||||
}
|
||||
dson_saved = dson;
|
||||
|
||||
render_screen(arena,
|
||||
dpy, locks,
|
||||
|
||||
Reference in new issue
Block a user