Skip to content

Commit 8a448bd

Browse files
Rename XSECURELOCK_SAVER_STOP_ON_DPMS (#157)
The correct name should be XSECURELOCK_SAVER_STOP_ON_BLANK. We also starts children when screensaver is on, but screen is not blanked, or when screensaver is one and screen is blanked, but this option is not enabled.
1 parent 15e9b01 commit 8a448bd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ Options to XSecureLock can be passed by environment variables:
443443
* `XSECURELOCK_SAVER_DELAY_MS`: Milliseconds to wait after starting
444444
children process and before mapping windows to let children be
445445
ready to display and reduce the black flash.
446-
* `XSECURELOCK_SAVER_STOP_ON_DPMS`: specifies if saver is stopped
447-
when DPMS blanks the screen (to save power).
446+
* `XSECURELOCK_SAVER_STOP_ON_BLANK`: specifies if saver is stopped
447+
when screen is blanked (DPMS or XSS) to save power.
448448
* `XSECURELOCK_XSCREENSAVER_PATH`: Location where XScreenSaver hacks are
449449
installed for use by `saver_xscreensaver`.
450450

main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ const char *blank_dpms_state = "off";
152152
int saver_reset_on_auth_close = 0;
153153
//! Delay we should wait before starting mapping windows to let children run.
154154
int saver_delay_ms = 0;
155-
//! Whetever stopping saver when DPMS is running
156-
int saver_stop_on_dpms = 0;
155+
//! Whetever stopping saver when screen is blanked.
156+
int saver_stop_on_blank = 0;
157157

158158
//! The PID of a currently running notify command, or 0 if none is running.
159159
pid_t notify_command_pid = 0;
@@ -443,7 +443,7 @@ void LoadDefaults() {
443443
saver_reset_on_auth_close =
444444
GetIntSetting("XSECURELOCK_SAVER_RESET_ON_AUTH_CLOSE", 0);
445445
saver_delay_ms = GetIntSetting("XSECURELOCK_SAVER_DELAY_MS", 0);
446-
saver_stop_on_dpms = GetIntSetting("XSECURELOCK_SAVER_STOP_ON_DPMS", 1);
446+
saver_stop_on_blank = GetIntSetting("XSECURELOCK_SAVER_STOP_ON_BLANK", 1);
447447
}
448448

449449
/*! \brief Parse the command line arguments, or exit in case of failure.
@@ -1110,7 +1110,7 @@ int main(int argc, char **argv) {
11101110
if (scrnsaver_event_base != 0) {
11111111
XScreenSaverInfo *info = XScreenSaverAllocInfo();
11121112
XScreenSaverQueryInfo(display, root_window, info);
1113-
if (info->state == ScreenSaverOn) {
1113+
if (info->state == ScreenSaverOn && info->kind == ScreenSaverBlanked && saver_stop_on_blank) {
11141114
xss_requested_saver_state = WATCH_CHILDREN_SAVER_DISABLED;
11151115
}
11161116
XFree(info);
@@ -1174,7 +1174,7 @@ int main(int argc, char **argv) {
11741174

11751175
// Make sure to shut down the saver when blanked. Saves power.
11761176
enum WatchChildrenState requested_saver_state =
1177-
(saver_stop_on_dpms && blanked) ? WATCH_CHILDREN_SAVER_DISABLED : xss_requested_saver_state;
1177+
(saver_stop_on_blank && blanked) ? WATCH_CHILDREN_SAVER_DISABLED : xss_requested_saver_state;
11781178

11791179
// Now check status of our children.
11801180
if (WatchChildren(display, auth_window, saver_window, requested_saver_state,

0 commit comments

Comments
 (0)