Skip to content

Commit 49ff9c9

Browse files
committed
Add option to not kill saver when DPMS kicks in
1 parent 591b2a7 commit 49ff9c9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ Options to XSecureLock can be passed by environment variables:
408408
locking) when above xss-lock command line is used. Should be at least as
409409
large as the period time set using "xset s". Also used by `wait_nonidle` to
410410
know when to assume dimming and waiting has finished and exit.
411+
* `XSECURELOCK_SAVER_STOP_ON_DPMS`: specifies if saver is stopped
412+
when DPMS blanks the screen (to save power).
411413
* `XSECURELOCK_XSCREENSAVER_PATH`: Location where XScreenSaver hacks are
412414
installed for use by `saver_xscreensaver`.
413415

main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ int force_grab = 0;
144144
int debug_window_info = 0;
145145
//! Whether to reset the saver module when auth closes.
146146
int saver_reset_on_auth_close = 0;
147+
//! Whetever stopping saver when DPMS is running
148+
int saver_stop_on_dpms = 0;
147149

148150
//! The PID of a currently running notify command, or 0 if none is running.
149151
pid_t notify_command_pid = 0;
@@ -339,6 +341,7 @@ void LoadDefaults() {
339341
debug_window_info = GetIntSetting("XSECURELOCK_DEBUG_WINDOW_INFO", 0);
340342
saver_reset_on_auth_close =
341343
GetIntSetting("XSECURELOCK_SAVER_RESET_ON_AUTH_CLOSE", 0);
344+
saver_stop_on_dpms = GetIntSetting("XSECURELOCK_SAVER_STOP_ON_DPMS", 1);
342345
}
343346

344347
/*! \brief Parse the command line arguments, or exit in case of failure.
@@ -1036,7 +1039,8 @@ int main(int argc, char **argv) {
10361039
select(x11_fd + 1, &in_fds, 0, 0, &tv);
10371040

10381041
// Make sure to shut down the saver when blanked. Saves power.
1039-
enum WatchChildrenState requested_saver_state = IsBlankedByDPMS(display) ?
1042+
enum WatchChildrenState requested_saver_state =
1043+
(saver_stop_on_dpms && IsBlankedByDPMS(display)) ?
10401044
WATCH_CHILDREN_SAVER_DISABLED : xss_requested_saver_state;
10411045

10421046
// Now check status of our children.

0 commit comments

Comments
 (0)