summaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/Makefile.in16
-rw-r--r--driver/XScreenSaver.ad.in286
-rw-r--r--driver/XScreenSaver_Xm_ad.h108
-rw-r--r--driver/XScreenSaver_ad.h420
-rw-r--r--driver/demo-Gtk.c8
-rw-r--r--driver/demo-Xm.c3
-rw-r--r--driver/lock.c4
-rw-r--r--driver/remote.c118
-rw-r--r--driver/screens.c4
-rw-r--r--driver/splash.c2
-rw-r--r--driver/subprocs.c24
-rw-r--r--driver/types.h5
-rw-r--r--driver/windows.c20
-rw-r--r--driver/xscreensaver-command.c15
-rw-r--r--driver/xscreensaver-command.man11
-rw-r--r--driver/xscreensaver-systemd.c232
-rw-r--r--driver/xscreensaver-systemd.man49
-rw-r--r--driver/xscreensaver.c64
-rw-r--r--driver/xscreensaver.h5
-rw-r--r--driver/xscreensaver.man17
20 files changed, 771 insertions, 640 deletions
diff --git a/driver/Makefile.in b/driver/Makefile.in
index b13853e..4ca00b6 100644
--- a/driver/Makefile.in
+++ b/driver/Makefile.in
@@ -113,6 +113,10 @@ LOCK_OBJS_1 = lock.o passwd.o
NOLOCK_SRCS_1 = lock.c
NOLOCK_OBJS_1 = lock.o
+SYSTEMD_SRCS = xscreensaver-systemd.c
+SYSTEMD_OBJS = xscreensaver-systemd.o
+SYSTEMD_LIBS = -lsystemd
+
TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c test-grab.c \
test-apm.c test-fade.c test-xinerama.c test-vp.c \
test-randr.c xdpyinfo.c test-mlstring.c test-screens.c \
@@ -216,9 +220,10 @@ GETIMG_LIBS = $(LIBS) $(X_LIBS) $(PNG_LIBS) $(JPEG_LIBS) \
$(X_PRE_LIBS) -lXt -lX11 $(XMU_LIBS) -lXext $(X_EXTRA_LIBS)
EXES = xscreensaver xscreensaver-command xscreensaver-demo \
- xscreensaver-getimage @EXES_OSX@
+ xscreensaver-getimage @EXES_OSX@ @EXES_SYSTEMD@
EXES2 = @ALL_DEMO_PROGRAMS@
EXES_OSX = pdf2jpeg
+EXES_SYSTEMD = xscreensaver-systemd
SCRIPTS_1 = xscreensaver-getimage-file xscreensaver-getimage-video \
xscreensaver-text
@@ -233,7 +238,8 @@ MEN_1 = xscreensaver.man xscreensaver-demo.man \
xscreensaver-text.man \
xscreensaver-getimage.man \
xscreensaver-getimage-file.man \
- xscreensaver-getimage-video.man
+ xscreensaver-getimage-video.man \
+ xscreensaver-systemd.man
MEN_OSX = xscreensaver-getimage-desktop.man pdf2jpeg.man
MEN = $(MEN_1) @MEN_OSX@
@@ -246,7 +252,7 @@ VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
-TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
+TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) $(SYSTEMD_SRCS) \
$(MOTIF_SRCS) $(GTK_SRCS) $(PWENT_SRCS) $(PWHELPER_SRCS) \
$(KERBEROS_SRCS) $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) \
$(CMD_SRCS) $(GETIMG_SRCS_1) $(PDF2JPEG_SRCS) $(HDRS) \
@@ -647,7 +653,7 @@ distdepend: check_men update_ad_version XScreenSaver_ad.h XScreenSaver_Xm_ad.h
$(INCLUDES_1) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
$(SAVER_SRCS_1) $(MOTIF_SRCS) $(GTK_SRCS) $(GETIMG_SRCS_1) \
$(PWENT_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) \
- $(TEST_SRCS) 2>/dev/null | \
+ $(SYSTEMD_SRCS) $(TEST_SRCS) 2>/dev/null | \
sort -d | \
( \
awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
@@ -820,6 +826,8 @@ xscreensaver-getimage: $(GETIMG_OBJS)
pdf2jpeg: $(PDF2JPEG_OBJS)
$(OBJCC) $(LDFLAGS) -o $@ $(PDF2JPEG_OBJS) $(PDF2JPEG_LIBS) -lm
+xscreensaver-systemd: $(SYSTEMD_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $(SYSTEMD_OBJS) $(SYSTEMD_LIBS) -lm
TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
subprocs.o setuid.o splash.o prefs.o mlstring.o exec.o \
diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in
index 7ffae10..8a4cc6c 100644
--- a/driver/XScreenSaver.ad.in
+++ b/driver/XScreenSaver.ad.in
@@ -4,8 +4,8 @@
! a screen saver and locker for the X window system
! by Jamie Zawinski
!
-! version 5.42
-! 28-Dec-2018
+! version 5.43
+! 09-Jul-2019
!
! See "man xscreensaver" for more info. The latest version is always
! available at https://www.jwz.org/xscreensaver/
@@ -56,7 +56,7 @@
*splash: True
*splashDuration: 0:00:05
*visualID: default
-*captureStderr: True
+*installColormap: True
*ignoreUninstalledPrograms: False
*authWarningSlack: 20
@@ -66,12 +66,16 @@
*textProgram: fortune
*textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss
+! When a saver writes an error message to stdout/stderr, it can be printed
+! on the screen.
+!
+*captureStderr: True
+*overlayStderr: True
*overlayTextForeground: #FFFF00
*overlayTextBackground: #000000
-*overlayStderr: True
*font: *-medium-r-*-140-*-m-*
-! The default is to use these extensions if available (as noted.)
+! The default is to use these server extensions if available (as noted.)
*sgiSaverExtension: True
*xidleExtension: True
*procInterrupts: True
@@ -81,14 +85,11 @@
! Set this to True if you are experiencing longstanding XFree86 bug #421
! (xscreensaver not covering the whole screen)
-GetViewPortIsFullOfLies: False
+*GetViewPortIsFullOfLies: False
-! This is what the "Demo" button on the splash screen runs (/bin/sh syntax.)
+! This is what the "Settings" button on the splash screen runs.
*demoCommand: xscreensaver-demo
-! This is what the "Prefs" button on the splash screen runs (/bin/sh syntax.)
-*prefsCommand: xscreensaver-demo -prefs
-
! This is the URL loaded by the "Help" button on the splash screen,
! and by the "Documentation" menu item in xscreensaver-demo.
*helpURL: https://www.jwz.org/xscreensaver/man.html
@@ -125,6 +126,8 @@ GetViewPortIsFullOfLies: False
! The format used for printing the date and time in the password dialog box
! (see the strftime(3) manual page for details.)
*dateFormat: %d-%b-%y (%a); %I:%M %p
+! For day month date:
+! *dateFormat: %a %b %d, %I:%M %p
! To show the time only:
! *dateFormat: %I:%M %p
! For 24 hour time:
@@ -149,15 +152,195 @@ GetViewPortIsFullOfLies: False
*externalUngrabCommand:
-! Turning on "installColormap" on 8-bit systems interacts erratically with
-! certain jurassic window managers. If your screen turns some color other
-! than black, the window manager is buggy, and you need to set this resource
-! to false. Or switch WMs. Or join the 21st century and get a 24-bit
-! graphics card.
+! Change these at your peril:
!
-*installColormap: True
+XScreenSaver.pointerPollTime: 0:00:05
+XScreenSaver.pointerHysteresis: 10
+XScreenSaver.initialDelay: 0:00:00
+XScreenSaver.windowCreationTimeout: 0:00:30
+XScreenSaver.bourneShell: /bin/sh
+
+!=============================================================================
+!
+! Colors and fonts for the unlock dialog and splash screen.
+!
+!=============================================================================
+! Note, the daemon uses Xlib XLoadFont, not Xft. If these fonts don't
+! exist, arcane heuristics are applied until we find something similar.
+!
+*Dialog.headingFont: -*-helvetica-bold-r-*-*-*-180-*-*-*-*-iso8859-1
+*Dialog.bodyFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1
+*Dialog.labelFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1
+*Dialog.unameFont: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1
+*Dialog.buttonFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1
+*Dialog.dateFont: -*-helvetica-medium-r-*-*-*-80-*-*-*-*-iso8859-1
+
+! Helvetica asterisks look terrible.
+*passwd.passwdFont: -*-courier-bold-r-*-*-*-140-*-*-*-iso8859-1
+
+! Whether to display the local host name in the unlock dialog.
+*passwd.uname: True
+
+! Whether typed passwords should echo as asterisks (true) or nothing (false)
+*passwd.asterisks: True
+
+
+! The default color scheme for the unlock and splash dialogs.
+! This looks pretty close to the default Gtk theme.
+!
+*Dialog.foreground: #000000
+*Dialog.background: #E6E6E6
+*Dialog.Button.foreground: #000000
+*Dialog.Button.background: #F5F5F5
+*Dialog.text.foreground: #000000
+*Dialog.text.background: #FFFFFF
+*Dialog.topShadowColor: #FFFFFF
+*Dialog.bottomShadowColor: #CECECE
+*Dialog.logo.width: 210
+*Dialog.logo.height: 210
+*Dialog.internalBorderWidth: 24
+*Dialog.borderWidth: 1
+*Dialog.shadowThickness: 2
+*passwd.thermometer.foreground: #4464AC
+*passwd.thermometer.background: #FFFFFF
+*passwd.thermometer.width: 8
+
+
+! A few other example color schemes.
+!
+! A convenient way to debug these is to build and run "driver/test-passwd".
+! Remember that configure overwrites XScreenSaver.ad from XScreenSaver.ad.in.
+
+
+! Borderless theme:
+!
+! *Dialog.topShadowColor: #E6E6E6
+! *Dialog.bottomShadowColor: #E6E6E6
+! *passwd.thermometer.width: 6
+
+
+! Dark gray theme:
+!
+! *Dialog.foreground: #CCCCCC
+! *Dialog.background: #333333
+! *Dialog.topShadowColor: #444444
+! *Dialog.bottomShadowColor: #111111
+! *Dialog.text.foreground: #DDDDDD
+! *Dialog.text.background: #666666
+! *Dialog.Button.foreground: #CCCCCC
+! *Dialog.Button.background: #666666
+! *passwd.thermometer.foreground: #4464AC
+! *passwd.thermometer.background: #666666
+
+
+! Black borderless theme:
+!
+! *Dialog.foreground: #CCCCCC
+! *Dialog.background: #000000
+! *Dialog.topShadowColor: #000000
+! *Dialog.bottomShadowColor: #000000
+! *Dialog.text.foreground: #CCCCCC
+! *Dialog.text.background: #000000
+! *Dialog.Button.foreground: #CCCCCC
+! *Dialog.Button.background: #333333
+! *passwd.thermometer.foreground: #CCCCCC
+! *passwd.thermometer.background: #333333
+! *passwd.thermometer.width: 3
+
+
+! Green on black theme:
+!
+! *Dialog.foreground: #00FF00
+! *Dialog.background: #000000
+! *Dialog.topShadowColor: #000000
+! *Dialog.bottomShadowColor: #000000
+! *Dialog.shadowThickness: 1
+! *Dialog.text.foreground: #00FF00
+! *Dialog.text.background: #006600
+! *Dialog.Button.foreground: #00FF00
+! *Dialog.Button.background: #006600
+! *passwd.thermometer.foreground: #00CC00
+! *passwd.thermometer.background: #006600
+
+
+! White theme:
+!
+! *Dialog.foreground: #000000
+! *Dialog.background: #FFFFFF
+! *Dialog.topShadowColor: #CCCCCC
+! *Dialog.bottomShadowColor: #CCCCCC
+! *Dialog.shadowThickness: 1
+! *Dialog.text.foreground: #000000
+! *Dialog.text.background: #FFFFFF
+! *Dialog.Button.foreground: #000000
+! *Dialog.Button.background: #FFFFFF
+
+
+! Blue theme:
+!
+! *Dialog.foreground: #000000
+! *Dialog.background: #BBCCDD
+! *Dialog.topShadowColor: #CCDDEE
+! *Dialog.bottomShadowColor: #AABBCC
+! *Dialog.text.foreground: #000000
+! *Dialog.text.background: #DDEEFF
+! *Dialog.Button.foreground: #000000
+! *Dialog.Button.background: #DDEEFF
+! *passwd.thermometer.foreground: #5566AA
+! *passwd.thermometer.background: #BBCCDD
+
+
+! Aqua on black borderless theme:
+!
+! *Dialog.foreground: #00EFEF
+! *Dialog.background: #000000
+! *Dialog.topShadowColor: #000000
+! *Dialog.bottomShadowColor: #000000
+! *Dialog.Button.foreground: #000000
+! *Dialog.Button.background: #2244EE
+! *Dialog.text.foreground: #2244EE
+! *Dialog.text.background: #EEEEEE
+! *Dialog.internalBorderWidth: 36
+! *Dialog.borderWidth: 4
+! *Dialog.shadowThickness: 2
+! *passwd.thermometer.foreground: #2244EE
+! *passwd.thermometer.background: #000088
+
+
+! Wine theme, similar to the login screen of "Ubuntu 18.04 Community".
+!
+! *Dialog.foreground: #AD8FA6
+! *Dialog.background: #2C041E
+! *Dialog.topShadowColor: #2C041E
+! *Dialog.bottomShadowColor: #2C041E
+! *Dialog.text.foreground: #706B70
+! *Dialog.text.background: #F9F9F8
+! *Dialog.Button.foreground: #CFC8CB
+! *Dialog.Button.background: #4D2946
+! *passwd.thermometer.foreground: #AD8FA6
+! *passwd.thermometer.background: #4D2946
+! *passwd.thermometer.width: 6
+
+
+! Static text in the dialog boxes:
+!
+*passwd.heading.label: XScreenSaver %s
+*passwd.body.label: This screen is locked.
+*passwd.unlock.label: OK
+*passwd.login.label: New Login
+*passwd.user.label: Username:
+
+*splash.heading.label: XScreenSaver %s
+*splash.body.label: Copyright \251 1991-2019 by
+*splash.body2.label: Jamie Zawinski <jwz@jwz.org>
+*splash.demo.label: Settings
+*splash.help.label: Help
+
+
+!=============================================================================
+!
! This is the list of installed screen saver modes. See "man xscreensaver"
! for the syntax used here.
!
@@ -167,6 +350,8 @@ GetViewPortIsFullOfLies: False
! You can use the `xscreensaver-demo' program to edit the current list of
! screen savers interactively.
!
+!=============================================================================
+
*programs: \
maze -root \n\
@GL_KLUDGE@ GL: superquadrics -root \n\
@@ -400,75 +585,16 @@ GetViewPortIsFullOfLies: False
@GL_KLUDGE@ GL: maze3d -root \n\
@GL_KLUDGE@ GL: peepers -root \n\
@GL_KLUDGE@ GL: razzledazzle -root \n\
- vfeedback -root \n
-
-
-
-!=============================================================================
-!
-! You probably don't want to change anything after this point.
-!
-!=============================================================================
-
-
-XScreenSaver.pointerPollTime: 0:00:05
-XScreenSaver.pointerHysteresis: 10
-XScreenSaver.initialDelay: 0:00:00
-XScreenSaver.windowCreationTimeout: 0:00:30
-XScreenSaver.bourneShell: /bin/sh
-
-
-! Resources for the password and splash-screen dialog boxes of
-! the "xscreensaver" daemon.
-!
-*Dialog.headingFont: -*-helvetica-bold-r-*-*-*-180-*-*-*-*-iso8859-1
-*Dialog.bodyFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1
-*Dialog.labelFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1
-*Dialog.unameFont: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1
-*Dialog.buttonFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1
-*Dialog.dateFont: -*-helvetica-medium-r-*-*-*-80-*-*-*-*-iso8859-1
-
-! Helvetica asterisks look terrible.
-*passwd.passwdFont: -*-courier-medium-r-*-*-*-140-*-*-*-iso8859-1
-
-
-*Dialog.foreground: #000000
-*Dialog.background: #E6E6E6
-*Dialog.Button.foreground: #000000
-*Dialog.Button.background: #F5F5F5
-!*Dialog.Button.pointBackground: #EAEAEA
-!*Dialog.Button.clickBackground: #C3C3C3
-*Dialog.text.foreground: #000000
-*Dialog.text.background: #FFFFFF
-*passwd.thermometer.foreground: #4464AC
-*passwd.thermometer.background: #FFFFFF
-*Dialog.topShadowColor: #FFFFFF
-*Dialog.bottomShadowColor: #CECECE
-*Dialog.logo.width: 210
-*Dialog.logo.height: 210
-*Dialog.internalBorderWidth: 24
-*Dialog.borderWidth: 1
-*Dialog.shadowThickness: 2
+ vfeedback -root \n\
+@GL_KLUDGE@ GL: deepstars -root \n\
+@GL_KLUDGE@ GL: gravitywell -root \n
-*passwd.heading.label: XScreenSaver %s
-*passwd.body.label: This screen is locked.
-*passwd.unlock.label: OK
-*passwd.login.label: New Login
-*passwd.user.label: Username:
-*passwd.thermometer.width: 8
-*passwd.asterisks: True
-*passwd.uname: True
-
-*splash.heading.label: XScreenSaver %s
-*splash.body.label: Copyright \251 1991-2018 by
-*splash.body2.label: Jamie Zawinski <jwz@jwz.org>
-*splash.demo.label: Settings
-*splash.help.label: Help
!=============================================================================
!
! Pretty names for the hacks that have unusual capitalization.
+! Used by xscreensaver-demo.
!
!=============================================================================
@@ -493,6 +619,7 @@ XScreenSaver.bourneShell: /bin/sh
*hacks.cwaves.name: CWaves
*hacks.dangerball.name: DangerBall
*hacks.decayscreen.name: DecayScreen
+*hacks.deepstars.name: DeepStars
*hacks.dnalogo.name: DNA Logo
*hacks.dymaxionmap.name: DymaxionMap
*hacks.energystream.name: EnergyStream
@@ -511,6 +638,7 @@ XScreenSaver.bourneShell: /bin/sh
*hacks.gleidescope.name: Gleidescope
*hacks.glforestfire.name: GLForestFire
*hacks.glitchpeg.name: GlitchPEG
+*hacks.gravitywell.name: GravityWell
*hacks.hyperball.name: HyperBall
*hacks.hypercube.name: HyperCube
*hacks.ifs.name: IFS
diff --git a/driver/XScreenSaver_Xm_ad.h b/driver/XScreenSaver_Xm_ad.h
deleted file mode 100644
index 371e0a2..0000000
--- a/driver/XScreenSaver_Xm_ad.h
+++ /dev/null
@@ -1,108 +0,0 @@
-"*fontList: *-helvetica-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*demoDialog*label1.fontList: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1",
-"*cmdText.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*label0.fontList: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
-"XScreenSaver*doc.fontList: *-helvetica-medium-r-*-*-*-100-*-*-*-iso8859-1",
-"*foreground: #000000",
-"*background: #C0C0C0",
-"*XmTextField.foreground: #000000",
-"*XmTextField.background: #FFFFFF",
-"*list.foreground: #000000",
-"*list.background: #FFFFFF",
-"*ApplicationShell.title: XScreenSaver",
-"*warning.title: XScreenSaver",
-"*warning_popup.title: XScreenSaver",
-"*allowShellResize: True",
-"*autoUnmanage: False",
-"*menubar*file.labelString: File",
-"*menubar*file.mnemonic: F",
-"*file.blank.labelString: Blank Screen Now",
-"*file.blank.mnemonic: B",
-"*file.lock.labelString: Lock Screen Now",
-"*file.lock.mnemonic: L",
-"*file.kill.labelString: Kill Daemon",
-"*file.kill.mnemonic: K",
-"*file.restart.labelString: Restart Daemon",
-"*file.restart.mnemonic: R",
-"*file.exit.labelString: Exit",
-"*file.exit.mnemonic: E",
-"*menubar*edit.labelString: Edit",
-"*menubar*edit.mnemonic: E",
-"*edit.cut.labelString: Cut",
-"*edit.cut.mnemonic: u",
-"*edit.copy.labelString: Copy",
-"*edit.copy.mnemonic: C",
-"*edit.paste.labelString: Paste",
-"*edit.paste.mnemonic: P",
-"*menubar*help.labelString: Help",
-"*menubar*help.mnemonic: H",
-"*help.about.labelString: About...",
-"*help.about.mnemonic: A",
-"*help.docMenu.labelString: Documentation...",
-"*help.docMenu.mnemonic: D",
-"*demoTab.marginWidth: 10",
-"*optionsTab.marginWidth: 10",
-"*XmScrolledWindow.topOffset: 10",
-"*XmScrolledWindow.leftOffset: 10",
-"*demoTab.topOffset: 4",
-"*form1.bottomOffset: 10",
-"*form3.leftOffset: 10",
-"*form3.rightOffset: 10",
-"*frame.topOffset: 10",
-"*frame.bottomOffset: 10",
-"*enabled.topOffset: 10",
-"*visLabel.topOffset: 10",
-"*combo.topOffset: 10",
-"*form4.bottomOffset: 4",
-"*hr.bottomOffset: 4",
-"*XmComboBox.marginWidth: 0",
-"*XmComboBox.marginHeight: 0",
-"*demo.marginWidth: 30",
-"*demo.marginHeight: 4",
-"*man.marginWidth: 10",
-"*man.marginHeight: 4",
-"*down.leftOffset: 40",
-"*down.marginWidth: 4",
-"*down.marginHeight: 4",
-"*up.marginWidth: 4",
-"*up.marginHeight: 4",
-"*frame.traversalOn: False",
-"*list.automaticSelection: True",
-"*list.visibleItemCount: 20",
-"*doc.columns: 60",
-"*combo.columns: 11",
-"*demoTab.labelString: Graphics Demos",
-"*optionsTab.labelString: Screensaver Options",
-"*down.labelString: \\\\/ ",
-"*up.labelString: /\\\\ ",
-"*frameLabel.labelString: ",
-"*cmdLabel.labelString: Command Line:",
-"*cmdLabel.alignment: ALIGNMENT_BEGINNING",
-"*enabled.labelString: Enabled",
-"*visLabel.labelString: Visual:",
-"*visLabel.alignment: ALIGNMENT_END",
-"*visLabel.leftOffset: 20",
-"*demo.labelString: Demo",
-"*man.labelString: Documentation...",
-"*done.labelString: Quit",
-"*preferencesLabel.labelString: XScreenSaver Parameters",
-"*timeoutLabel.labelString: Saver Timeout",
-"*cycleLabel.labelString: Cycle Timeout",
-"*fadeSecondsLabel.labelString: Fade Duration",
-"*fadeTicksLabel.labelString: Fade Ticks",
-"*lockLabel.labelString: Lock Timeout",
-"*passwdLabel.labelString: Password Timeout",
-"*preferencesForm*XmTextField.columns: 8",
-"*verboseToggle.labelString: Verbose",
-"*cmapToggle.labelString: Install Colormap",
-"*fadeToggle.labelString: Fade Colormap",
-"*unfadeToggle.labelString: Unfade Colormap",
-"*lockToggle.labelString: Require Password",
-"*OK.marginWidth: 30",
-"*OK.marginHeight: 4",
-"*OK.leftOffset: 10",
-"*OK.bottomOffset: 10",
-"*Cancel.marginWidth: 30",
-"*Cancel.marginHeight: 4",
-"*Cancel.rightOffset: 10",
-"*Cancel.bottomOffset: 10",
diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h
deleted file mode 100644
index 238901a..0000000
--- a/driver/XScreenSaver_ad.h
+++ /dev/null
@@ -1,420 +0,0 @@
-"#error Do not run app-defaults files through xrdb!",
-"#error That does not do what you might expect.",
-"#error Put this file in /usr/lib/X11/app-defaults/XScreenSaver instead.",
-"*mode: random",
-"*timeout: 0:10:00",
-"*cycle: 0:10:00",
-"*lockTimeout: 0:00:00",
-"*passwdTimeout: 0:00:30",
-"*dpmsEnabled: False",
-"*dpmsQuickoffEnabled: False",
-"*dpmsStandby: 2:00:00",
-"*dpmsSuspend: 2:00:00",
-"*dpmsOff: 4:00:00",
-"*dpmsFullThrottle: False",
-"*grabDesktopImages: True",
-"*grabVideoFrames: False",
-"*chooseRandomImages: True",
-"*imageDirectory: /usr/share/wallpapers/",
-"*nice: 10",
-"*memoryLimit: 0",
-"*lock: False",
-"*verbose: False",
-"*timestamp: True",
-"*fade: True",
-"*unfade: False",
-"*fadeSeconds: 0:00:03",
-"*fadeTicks: 20",
-"*splash: True",
-"*splashDuration: 0:00:05",
-"*visualID: default",
-"*captureStderr: True",
-"*ignoreUninstalledPrograms: False",
-"*authWarningSlack: 20",
-"*textMode: file",
-"*textLiteral: XScreenSaver",
-"*textFile: /usr/share/doc/xserver-common/copyright",
-"*textProgram: fortune",
-"*textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss",
-"*overlayTextForeground: #FFFF00",
-"*overlayTextBackground: #000000",
-"*overlayStderr: True",
-"*font: *-medium-r-*-140-*-m-*",
-"*sgiSaverExtension: True",
-"*xidleExtension: True",
-"*procInterrupts: True",
-"*xinputExtensionDev: False",
-"GetViewPortIsFullOfLies: False",
-"*demoCommand: xscreensaver-demo",
-"*prefsCommand: xscreensaver-demo -prefs",
-"*helpURL: https://www.jwz.org/xscreensaver/man.html",
-"*loadURL: gnome-open '%s'",
-"*manualCommand: gnome-terminal --title '%s manual' \
- --command '/bin/sh -c \"man %s; read foo\"'",
-"*dateFormat: %d-%b-%y (%a); %I:%M %p",
-"*newLoginCommand: dm-tool switch-to-greeter",
-"*externalUngrabCommand: ",
-"*installColormap: True",
-"*programs: \
- maze -root \\n\
- GL: superquadrics -root \\n\
- attraction -root \\n\
- blitspin -root \\n\
- greynetic -root \\n\
- helix -root \\n\
- hopalong -root \\n\
- imsmap -root \\n\
-- noseguy -root \\n\
-- pyro -root \\n\
- qix -root \\n\
-- rocks -root \\n\
- rorschach -root \\n\
- decayscreen -root \\n\
- flame -root \\n\
- halo -root \\n\
- slidescreen -root \\n\
- pedal -root \\n\
- bouboule -root \\n\
-- braid -root \\n\
- coral -root \\n\
- deco -root \\n\
- drift -root \\n\
-- fadeplot -root \\n\
- galaxy -root \\n\
- goop -root \\n\
- grav -root \\n\
- ifs -root \\n\
- GL: jigsaw -root \\n\
- julia -root \\n\
-- kaleidescope -root \\n\
- GL: moebius -root \\n\
- moire -root \\n\
- GL: morph3d -root \\n\
- mountain -root \\n\
- munch -root \\n\
- penrose -root \\n\
- GL: pipes -root \\n\
- rd-bomb -root \\n\
- GL: rubik -root \\n\
-- sierpinski -root \\n\
- slip -root \\n\
- GL: sproingies -root \\n\
- starfish -root \\n\
- strange -root \\n\
- swirl -root \\n\
- triangle -root \\n\
- xjack -root \\n\
- xlyap -root \\n\
- GL: atlantis -root \\n\
- bsod -root \\n\
- GL: bubble3d -root \\n\
- GL: cage -root \\n\
-- crystal -root \\n\
- cynosure -root \\n\
- discrete -root \\n\
- distort -root \\n\
- epicycle -root \\n\
- flow -root \\n\
- GL: glplanet -root \\n\
- interference -root \\n\
- kumppa -root \\n\
- GL: lament -root \\n\
- moire2 -root \\n\
- GL: sonar -root \\n\
- GL: stairs -root \\n\
- truchet -root \\n\
-- vidwhacker -root \\n\
- blaster -root \\n\
- bumps -root \\n\
- ccurve -root \\n\
- compass -root \\n\
- deluxe -root \\n\
-- demon -root \\n\
-- GL: extrusion -root \\n\
-- loop -root \\n\
- penetrate -root \\n\
- petri -root \\n\
- phosphor -root \\n\
- GL: pulsar -root \\n\
- ripples -root \\n\
- shadebobs -root \\n\
- GL: sierpinski3d -root \\n\
- spotlight -root \\n\
- squiral -root \\n\
- wander -root \\n\
-- webcollage -root \\n\
- xflame -root \\n\
- xmatrix -root \\n\
- GL: gflux -root \\n\
-- nerverot -root \\n\
- xrayswarm -root \\n\
- xspirograph -root \\n\
- GL: circuit -root \\n\
- GL: dangerball -root \\n\
-- GL: dnalogo -root \\n\
- GL: engine -root \\n\
- GL: flipscreen3d -root \\n\
- GL: gltext -root \\n\
- GL: menger -root \\n\
- GL: molecule -root \\n\
- rotzoomer -root \\n\
- speedmine -root \\n\
- GL: starwars -root \\n\
- GL: stonerview -root \\n\
- vermiculate -root \\n\
- whirlwindwarp -root \\n\
- zoom -root \\n\
- anemone -root \\n\
- apollonian -root \\n\
- GL: boxed -root \\n\
- GL: cubenetic -root \\n\
- GL: endgame -root \\n\
- euler2d -root \\n\
- fluidballs -root \\n\
- GL: flurry -root \\n\
-- GL: glblur -root \\n\
- GL: glsnake -root \\n\
- halftone -root \\n\
- GL: juggler3d -root \\n\
- GL: lavalite -root \\n\
-- polyominoes -root \\n\
- GL: queens -root \\n\
-- GL: sballs -root \\n\
- GL: spheremonics -root \\n\
-- thornbird -root \\n\
- twang -root \\n\
-- GL: antspotlight -root \\n\
- apple2 -root \\n\
- GL: atunnel -root \\n\
- barcode -root \\n\
- GL: blinkbox -root \\n\
- GL: blocktube -root \\n\
- GL: bouncingcow -root \\n\
- cloudlife -root \\n\
- GL: cubestorm -root \\n\
- eruption -root \\n\
- GL: flipflop -root \\n\
- GL: flyingtoasters -root \\n\
- fontglide -root \\n\
- GL: gleidescope -root \\n\
- GL: glknots -root \\n\
- GL: glmatrix -root \\n\
-- GL: glslideshow -root \\n\
- GL: hypertorus -root \\n\
-- GL: jigglypuff -root \\n\
- metaballs -root \\n\
- GL: mirrorblob -root \\n\
- piecewise -root \\n\
- GL: polytopes -root \\n\
- pong -root \\n\
- popsquares -root \\n\
- GL: surfaces -root \\n\
- xanalogtv -root \\n\
- abstractile -root \\n\
- anemotaxis -root \\n\
-- GL: antinspect -root \\n\
- fireworkx -root \\n\
- fuzzyflakes -root \\n\
- interaggregate -root \\n\
- intermomentary -root \\n\
- memscroller -root \\n\
- GL: noof -root \\n\
- pacman -root \\n\
- GL: pinion -root \\n\
- GL: polyhedra -root \\n\
-- GL: providence -root \\n\
- substrate -root \\n\
- wormhole -root \\n\
-- GL: antmaze -root \\n\
- GL: boing -root \\n\
- boxfit -root \\n\
- GL: carousel -root \\n\
- celtic -root \\n\
- GL: crackberg -root \\n\
- GL: cube21 -root \\n\
- fiberlamp -root \\n\
- GL: fliptext -root \\n\
- GL: glhanoi -root \\n\
- GL: tangram -root \\n\
- GL: timetunnel -root \\n\
- GL: glschool -root \\n\
- GL: topblock -root \\n\
- GL: cubicgrid -root \\n\
- cwaves -root \\n\
- GL: gears -root \\n\
- GL: glcells -root \\n\
- GL: lockward -root \\n\
- m6502 -root \\n\
- GL: moebiusgears -root \\n\
- GL: voronoi -root \\n\
- GL: hypnowheel -root \\n\
- GL: klein -root \\n\
-- lcdscrub -root \\n\
- GL: photopile -root \\n\
- GL: skytentacles -root \\n\
- GL: rubikblocks -root \\n\
- GL: companioncube -root \\n\
- GL: hilbert -root \\n\
- GL: tronbit -root \\n\
- GL: geodesic -root \\n\
- hexadrop -root \\n\
- GL: kaleidocycle -root \\n\
- GL: quasicrystal -root \\n\
- GL: unknownpleasures -root \\n\
- binaryring -root \\n\
- GL: cityflow -root \\n\
- GL: geodesicgears -root \\n\
- GL: projectiveplane -root \\n\
- GL: romanboy -root \\n\
- tessellimage -root \\n\
- GL: winduprobot -root \\n\
- GL: splitflap -root \\n\
- GL: cubestack -root \\n\
- GL: cubetwist -root \\n\
- GL: discoball -root \\n\
- GL: dymaxionmap -root \\n\
- GL: energystream -root \\n\
- GL: hexstrut -root \\n\
- GL: hydrostat -root \\n\
- GL: raverhoop -root \\n\
- GL: splodesic -root \\n\
- GL: unicrud -root \\n\
- GL: esper -root \\n\
- GL: vigilance -root \\n\
- GL: crumbler -root \\n\
- filmleader -root \\n\
- glitchpeg -root \\n\
- GL: handsy -root \\n\
- GL: maze3d -root \\n\
- GL: peepers -root \\n\
- GL: razzledazzle -root \\n\
- vfeedback -root \\n",
-"XScreenSaver.pointerPollTime: 0:00:05",
-"XScreenSaver.pointerHysteresis: 10",
-"XScreenSaver.initialDelay: 0:00:00",
-"XScreenSaver.windowCreationTimeout: 0:00:30",
-"XScreenSaver.bourneShell: /bin/sh",
-"*Dialog.headingFont: -*-helvetica-bold-r-*-*-*-180-*-*-*-*-iso8859-1",
-"*Dialog.bodyFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-"*Dialog.labelFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-"*Dialog.unameFont: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1",
-"*Dialog.buttonFont: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-iso8859-1",
-"*Dialog.dateFont: -*-helvetica-medium-r-*-*-*-80-*-*-*-*-iso8859-1",
-"*passwd.passwdFont: -*-courier-medium-r-*-*-*-140-*-*-*-iso8859-1",
-"*Dialog.foreground: #000000",
-"*Dialog.background: #E6E6E6",
-"*Dialog.Button.foreground: #000000",
-"*Dialog.Button.background: #F5F5F5",
-"*Dialog.text.foreground: #000000",
-"*Dialog.text.background: #FFFFFF",
-"*passwd.thermometer.foreground: #4464AC",
-"*passwd.thermometer.background: #FFFFFF",
-"*Dialog.topShadowColor: #FFFFFF",
-"*Dialog.bottomShadowColor: #CECECE",
-"*Dialog.logo.width: 210",
-"*Dialog.logo.height: 210",
-"*Dialog.internalBorderWidth: 24",
-"*Dialog.borderWidth: 1",
-"*Dialog.shadowThickness: 2",
-"*passwd.heading.label: XScreenSaver %s",
-"*passwd.body.label: This screen is locked.",
-"*passwd.unlock.label: OK",
-"*passwd.login.label: New Login",
-"*passwd.user.label: Username:",
-"*passwd.thermometer.width: 8",
-"*passwd.asterisks: True",
-"*passwd.uname: True",
-"*splash.heading.label: XScreenSaver %s",
-"*splash.body.label: Copyright \\251 1991-2018 by",
-"*splash.body2.label: Jamie Zawinski <jwz@jwz.org>",
-"*splash.demo.label: Settings",
-"*splash.help.label: Help",
-"*hacks.antinspect.name: AntInspect",
-"*hacks.antmaze.name: AntMaze",
-"*hacks.antspotlight.name: AntSpotlight",
-"*hacks.binaryring.name: BinaryRing",
-"*hacks.blinkbox.name: BlinkBox",
-"*hacks.blitspin.name: BlitSpin",
-"*hacks.blocktube.name: BlockTube",
-"*hacks.bouncingcow.name: BouncingCow",
-"*hacks.boxfit.name: BoxFit",
-"*hacks.bsod.name: BSOD",
-"*hacks.bubble3d.name: Bubble3D",
-"*hacks.ccurve.name: CCurve",
-"*hacks.cloudlife.name: CloudLife",
-"*hacks.companioncube.name: CompanionCube",
-"*hacks.cubestack.name: CubeStack",
-"*hacks.cubestorm.name: CubeStorm",
-"*hacks.cubetwist.name: CubeTwist",
-"*hacks.cubicgrid.name: CubicGrid",
-"*hacks.cwaves.name: CWaves",
-"*hacks.dangerball.name: DangerBall",
-"*hacks.decayscreen.name: DecayScreen",
-"*hacks.dnalogo.name: DNA Logo",
-"*hacks.dymaxionmap.name: DymaxionMap",
-"*hacks.energystream.name: EnergyStream",
-"*hacks.euler2d.name: Euler2D",
-"*hacks.fadeplot.name: FadePlot",
-"*hacks.filmleader.name: FilmLeader",
-"*hacks.flipflop.name: FlipFlop",
-"*hacks.flipscreen3d.name: FlipScreen3D",
-"*hacks.fliptext.name: FlipText",
-"*hacks.fluidballs.name: FluidBalls",
-"*hacks.flyingtoasters.name: FlyingToasters",
-"*hacks.fontglide.name: FontGlide",
-"*hacks.fuzzyflakes.name: FuzzyFlakes",
-"*hacks.geodesicgears.name: GeodesicGears",
-"*hacks.gflux.name: GFlux",
-"*hacks.gleidescope.name: Gleidescope",
-"*hacks.glforestfire.name: GLForestFire",
-"*hacks.glitchpeg.name: GlitchPEG",
-"*hacks.hyperball.name: HyperBall",
-"*hacks.hypercube.name: HyperCube",
-"*hacks.ifs.name: IFS",
-"*hacks.imsmap.name: IMSMap",
-"*hacks.jigglypuff.name: JigglyPuff",
-"*hacks.juggler3d.name: Juggler3D",
-"*hacks.lcdscrub.name: LCDscrub",
-"*hacks.lmorph.name: LMorph",
-"*hacks.m6502.name: m6502",
-"*hacks.maze3d.name: Maze3D",
-"*hacks.memscroller.name: MemScroller",
-"*hacks.metaballs.name: MetaBalls",
-"*hacks.mirrorblob.name: MirrorBlob",
-"*hacks.moebiusgears.name: MoebiusGears",
-"*hacks.morph3d.name: Morph3D",
-"*hacks.nerverot.name: NerveRot",
-"*hacks.noseguy.name: NoseGuy",
-"*hacks.popsquares.name: PopSquares",
-"*hacks.projectiveplane.name:ProjectivePlane",
-"*hacks.quasicrystal.name: QuasiCrystal",
-"*hacks.raverhoop.name: RaverHoop",
-"*hacks.razzledazzle.name: RazzleDazzle",
-"*hacks.rd-bomb.name: RDbomb",
-"*hacks.rdbomb.name: RDbomb",
-"*hacks.romanboy.name: RomanBoy",
-"*hacks.rotzoomer.name: RotZoomer",
-"*hacks.rubikblocks.name: RubikBlocks",
-"*hacks.sballs.name: SBalls",
-"*hacks.shadebobs.name: ShadeBobs",
-"*hacks.sierpinski3d.name: Sierpinski3D",
-"*hacks.skytentacles.name: SkyTentacles",
-"*hacks.slidescreen.name: SlideScreen",
-"*hacks.speedmine.name: SpeedMine",
-"*hacks.splitflap.name: SplitFlap",
-"*hacks.starwars.name: StarWars",
-"*hacks.stonerview.name: StonerView",
-"*hacks.t3d.name: T3D",
-"*hacks.testx11.name: TestX11",
-"*hacks.timetunnel.name: TimeTunnel",
-"*hacks.topblock.name: TopBlock",
-"*hacks.tronbit.name: TronBit",
-"*hacks.unknownpleasures.name:UnknownPleasures",
-"*hacks.vfeedback.name: VFeedback",
-"*hacks.vidwhacker.name: VidWhacker",
-"*hacks.webcollage.name: WebCollage",
-"*hacks.whirlwindwarp.name: WhirlWindWarp",
-"*hacks.winduprobot.name: WindupRobot",
-"*hacks.xanalogtv.name: XAnalogTV",
-"*hacks.xrayswarm.name: XRaySwarm",
-"*hacks.documentation.isInstalled: True",
diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c
index ef00d82..be4a238 100644
--- a/driver/demo-Gtk.c
+++ b/driver/demo-Gtk.c
@@ -1,5 +1,5 @@
/* demo-Gtk.c --- implements the interactive demo-mode and options dialogs.
- * xscreensaver, Copyright (c) 1993-2018 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -250,7 +250,8 @@ static state *global_state_kludge;
Atom XA_VROOT;
Atom XA_SCREENSAVER, XA_SCREENSAVER_RESPONSE, XA_SCREENSAVER_VERSION;
Atom XA_SCREENSAVER_ID, XA_SCREENSAVER_STATUS, XA_SELECT, XA_DEMO;
-Atom XA_ACTIVATE, XA_BLANK, XA_LOCK, XA_RESTART, XA_EXIT;
+Atom XA_ACTIVATE, XA_SUSPEND, XA_BLANK, XA_LOCK, XA_RESTART, XA_EXIT;
+Atom XA_NEXT, XA_PREV;
static void populate_demo_window (state *, int list_elt);
@@ -5069,8 +5070,11 @@ main (int argc, char **argv)
XA_SELECT = XInternAtom (dpy, "SELECT", False);
XA_DEMO = XInternAtom (dpy, "DEMO", False);
XA_ACTIVATE = XInternAtom (dpy, "ACTIVATE", False);
+ XA_SUSPEND = XInternAtom (dpy, "SUSPEND", False);
XA_BLANK = XInternAtom (dpy, "BLANK", False);
XA_LOCK = XInternAtom (dpy, "LOCK", False);
+ XA_NEXT = XInternAtom (dpy, "NEXT", False);
+ XA_PREV = XInternAtom (dpy, "PREV", False);
XA_EXIT = XInternAtom (dpy, "EXIT", False);
XA_RESTART = XInternAtom (dpy, "RESTART", False);
diff --git a/driver/demo-Xm.c b/driver/demo-Xm.c
index 149e7c5..3497641 100644
--- a/driver/demo-Xm.c
+++ b/driver/demo-Xm.c
@@ -113,7 +113,7 @@ static char *short_version = 0;
Atom XA_VROOT;
Atom XA_SCREENSAVER, XA_SCREENSAVER_RESPONSE, XA_SCREENSAVER_VERSION;
Atom XA_SCREENSAVER_ID, XA_SCREENSAVER_STATUS, XA_SELECT, XA_DEMO;
-Atom XA_ACTIVATE, XA_BLANK, XA_LOCK, XA_RESTART, XA_EXIT;
+Atom XA_ACTIVATE, XA_SUSPEND, XA_BLANK, XA_LOCK, XA_RESTART, XA_EXIT;
static void populate_demo_window (Widget toplevel,
@@ -1800,6 +1800,7 @@ main (int argc, char **argv)
XA_SELECT = XInternAtom (dpy, "SELECT", False);
XA_DEMO = XInternAtom (dpy, "DEMO", False);
XA_ACTIVATE = XInternAtom (dpy, "ACTIVATE", False);
+ XA_SUSPEND = XInternAtom (dpy, "SUSPEND", False);
XA_BLANK = XInternAtom (dpy, "BLANK", False);
XA_LOCK = XInternAtom (dpy, "LOCK", False);
XA_EXIT = XInternAtom (dpy, "EXIT", False);
diff --git a/driver/lock.c b/driver/lock.c
index 10b879e..7696f30 100644
--- a/driver/lock.c
+++ b/driver/lock.c
@@ -872,6 +872,7 @@ draw_passwd_window (saver_info *si)
memset (buf, 0, sizeof(buf));
strftime (buf, sizeof(buf)-1, pw->date_label, tm);
+ XSetForeground (si->dpy, gc1, pw->foreground);
XSetFont (si->dpy, gc1, pw->date_font->fid);
y1 += pw->shadow_width;
y1 += (spacing + tb_height);
@@ -1148,7 +1149,8 @@ update_passwd_window (saver_info *si, const char *printed_passwd, float ratio)
y = (pw->thermo_field_height - 2) * (1.0 - pw->ratio);
if (y > 0)
{
- XFillRectangle (si->dpy, si->passwd_dialog, gc2,
+ XSetForeground (si->dpy, gc1, pw->thermo_background);
+ XFillRectangle (si->dpy, si->passwd_dialog, gc1,
pw->thermo_field_x + 1,
pw->thermo_field_y + 1,
pw->thermo_width-2,
diff --git a/driver/remote.c b/driver/remote.c
index 775036a..83254e0 100644
--- a/driver/remote.c
+++ b/driver/remote.c
@@ -1,4 +1,4 @@
-/* xscreensaver-command, Copyright (c) 1991-2009 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver-command, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -43,6 +43,7 @@ extern char *progname;
extern Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_RESPONSE;
extern Atom XA_SCREENSAVER_ID, XA_SCREENSAVER_STATUS, XA_EXIT;
extern Atom XA_VROOT, XA_SELECT, XA_DEMO, XA_BLANK, XA_LOCK;
+extern Atom XA_ACTIVATE, XA_SUSPEND, XA_NEXT, XA_PREV, XA_EXIT;
static XErrorHandler old_handler = 0;
@@ -490,6 +491,109 @@ xscreensaver_command_response (Display *dpy, Window window,
}
+/* Wait until the window has been mapped, blanking the screen.
+ Catches errors, times out after a few seconds.
+ */
+static int
+xscreensaver_command_wait_for_blank (Display *dpy, Window window,
+ Bool verbose_p, char **error_ret)
+{
+ time_t start = time((time_t*)0);
+ int max = 10;
+ char err[2048];
+ Status status = -1;
+
+ while (1)
+ {
+ XWindowAttributes xgwa;
+ xgwa.map_state = IsUnmapped;
+
+ if (!window)
+ got_badwindow = True;
+ else
+ {
+ XSync (dpy, False);
+ if (old_handler) abort();
+ got_badwindow = False;
+ old_handler = XSetErrorHandler (BadWindow_ehandler);
+ status = XGetWindowAttributes (dpy, window, &xgwa);
+ XSync (dpy, False);
+ XSetErrorHandler (old_handler);
+ old_handler = 0;
+ }
+
+ if (got_badwindow)
+ {
+ /* If we got a BadWindow, it might be that in the course of
+ activating, xscreensaver had to destroy and re-create the
+ window to get one with the proper Visual. So wait for a
+ new window to come into existence.
+ */
+ if (window && verbose_p > 1)
+ fprintf (stderr,
+ "%s: BadWindow 0x%08x waiting for screen to blank\n",
+ progname, (unsigned int) window);
+ window = find_screensaver_window (dpy, 0);
+ if (window && verbose_p > 1)
+ fprintf (stderr, "%s: new window is 0x%08x.\n",
+ progname, (unsigned int) window);
+ got_badwindow = False;
+ }
+ else if (status == 0)
+ {
+ sprintf (err, "error on 0x%08x waiting for screen to blank",
+ (unsigned int) window);
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
+ return -1;
+ }
+ else if (xgwa.map_state == IsViewable)
+ {
+ if (verbose_p)
+ fprintf (stderr, "%s: window 0x%08x mapped.\n",
+ progname, (unsigned int) window);
+ return 0;
+ }
+ else
+ {
+ time_t now = time((time_t*)0);
+
+ if (now >= start + max)
+ {
+ sprintf (err, "Timed out waiting for screen to blank on 0x%08x",
+ (unsigned int) window);
+ if (error_ret)
+ *error_ret = strdup (err);
+ else
+ fprintf (stderr, "%s: %s\n", progname, err);
+ return -1;
+ }
+ else if (verbose_p && now > start+1)
+ {
+ fprintf (stderr, "%s: waiting for window 0x%08x to map\n",
+ progname, (unsigned int) window);
+ }
+ }
+
+# if defined(HAVE_SELECT)
+ {
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 1000000L / 10;
+ select (0, 0, 0, 0, &tv);
+ }
+# else
+ sleep (1);
+# endif
+ }
+
+ return 0;
+}
+
+
+
int
xscreensaver_command (Display *dpy, Atom command, long arg, Bool verbose_p,
char **error_ret)
@@ -501,6 +605,18 @@ xscreensaver_command (Display *dpy, Atom command, long arg, Bool verbose_p,
(command == XA_EXIT),
error_ret);
+ /* If this command should result in the screen being blank, wait until
+ the xscreensaver window is mapped before returning. */
+ if (status == 0 &&
+ (command == XA_ACTIVATE ||
+ command == XA_SUSPEND ||
+ command == XA_LOCK ||
+ command == XA_NEXT ||
+ command == XA_PREV ||
+ command == XA_SELECT))
+ status = xscreensaver_command_wait_for_blank (dpy, w, verbose_p,
+ error_ret);
+
fflush (stdout);
fflush (stderr);
return (status < 0 ? status : 0);
diff --git a/driver/screens.c b/driver/screens.c
index 1a2f41d..f319c96 100644
--- a/driver/screens.c
+++ b/driver/screens.c
@@ -576,7 +576,7 @@ randr_versus_xinerama_fight (Display *dpy, monitor **randr_monitors,
{
*errP = append (*errP,
"WARNING: RANDR reports 1 screen but Xinerama\n"
- "\t\treports multiple. Believing Xinerama.");
+ " reports multiple. Believing Xinerama.");
free_monitors (randr_monitors);
return xinerama_monitors;
}
@@ -584,7 +584,7 @@ randr_versus_xinerama_fight (Display *dpy, monitor **randr_monitors,
{
*errP = append (*errP,
"WARNING: RANDR and Xinerama report different\n"
- "\t\tscreen layouts! Believing RANDR.");
+ " screen layouts! Believing RANDR.");
free_monitors (xinerama_monitors);
return randr_monitors;
}
diff --git a/driver/splash.c b/driver/splash.c
index a4f1761..b971ade 100644
--- a/driver/splash.c
+++ b/driver/splash.c
@@ -881,7 +881,7 @@ do_prefs (saver_screen_info *ssi)
saver_preferences *p = &si->prefs;
const char *cmd = p->prefs_command;
- if (command && *command)
+ if (cmd && *cmd)
fork_and_exec (ssi, cmd);
else
fprintf (stderr, "%s: no preferences command has been specified.\n",
diff --git a/driver/subprocs.c b/driver/subprocs.c
index 9f4b075..c46eeee 100644
--- a/driver/subprocs.c
+++ b/driver/subprocs.c
@@ -1,5 +1,5 @@
/* subprocs.c --- choosing, spawning, and killing screenhacks.
- * xscreensaver, Copyright (c) 1991-2017 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -439,7 +439,7 @@ unblock_sigchld (void)
block_sigchld_handler--;
}
-static int
+int
kill_job (saver_info *si, pid_t pid, int signal)
{
saver_preferences *p = &si->prefs;
@@ -738,12 +738,18 @@ describe_dead_child (saver_info *si, pid_t kid, int wait_status)
/* Clear out the pid so that screenhack_running_p() knows it's dead.
*/
if (!job || job->status == job_dead)
+ {
for (i = 0; i < si->nscreens; i++)
{
saver_screen_info *ssi = &si->screens[i];
if (kid == ssi->pid)
ssi->pid = 0;
}
+# ifdef HAVE_LIBSYSTEMD
+ if (kid == si->systemd_pid)
+ si->systemd_pid = 0;
+# endif
+ }
}
#else /* VMS */
@@ -872,7 +878,12 @@ print_path_error (const char *program)
pid_t
fork_and_exec (saver_screen_info *ssi, const char *command)
{
- saver_info *si = ssi->global;
+ return fork_and_exec_1 (ssi->global, ssi, command);
+}
+
+pid_t
+fork_and_exec_1 (saver_info *si, saver_screen_info *ssi, const char *command)
+{
saver_preferences *p = &si->prefs;
pid_t forked;
@@ -889,11 +900,12 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
case 0:
close (ConnectionNumber (si->dpy)); /* close display fd */
limit_subproc_memory (p->inferior_memory_limit, p->verbose_p);
- hack_subproc_environment (ssi->screen, ssi->screensaver_window);
+ if (ssi)
+ hack_subproc_environment (ssi->screen, ssi->screensaver_window);
if (p->verbose_p)
fprintf (stderr, "%s: %d: spawning \"%s\" in pid %lu.\n",
- blurb(), ssi->number, command,
+ blurb(), (ssi ? ssi->number : 0), command,
(unsigned long) getpid ());
exec_command (p->shell, command, p->nice_inferior);
@@ -908,7 +920,7 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
break;
default: /* parent */
- (void) make_job (forked, ssi->number, command);
+ (void) make_job (forked, (ssi ? ssi->number : 0), command);
break;
}
diff --git a/driver/types.h b/driver/types.h
index 93c6731..98425c6 100644
--- a/driver/types.h
+++ b/driver/types.h
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993-2014 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -350,6 +350,9 @@ struct saver_info {
XtIntervalId stderr_popup_timer;
+# ifdef HAVE_LIBSYSTEMD
+ pid_t systemd_pid;
+# endif
};
/* This structure holds all the data that applies to the screen-specific parts
diff --git a/driver/windows.c b/driver/windows.c
index ceba8c8..38a611b 100644
--- a/driver/windows.c
+++ b/driver/windows.c
@@ -1,5 +1,5 @@
/* windows.c --- turning the screen black; dealing with visuals, virtual roots.
- * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -778,6 +778,16 @@ restore_real_vroot_handler (int sig)
if (restore_real_vroot (si))
fprintf (real_stderr, "\n%s: %s intercepted, vroot restored.\n",
blurb(), signal_name(sig));
+# ifdef HAVE_LIBSYSTEMD
+ if (si->systemd_pid) /* Kill background xscreensaver-systemd process */
+ {
+ /* We're exiting, so there's no need to do a full kill_job() here,
+ which will waitpid(). */
+ /* kill_job (si, si->systemd_pid, SIGTERM); */
+ kill (si->systemd_pid, SIGTERM);
+ si->systemd_pid = 0;
+ }
+# endif
kill (getpid (), sig);
}
@@ -898,6 +908,14 @@ saver_exit (saver_info *si, int status, const char *dump_core_reason)
if (p->verbose_p && vrs)
fprintf (real_stderr, "%s: old vroot restored.\n", blurb());
+# ifdef HAVE_LIBSYSTEMD
+ if (si->systemd_pid) /* Kill background xscreensaver-systemd process */
+ {
+ kill_job (si, si->systemd_pid, SIGTERM);
+ si->systemd_pid = 0;
+ }
+# endif
+
fflush(real_stdout);
#ifdef VMS /* on VMS, 1 is the "normal" exit code instead of 0. */
diff --git a/driver/xscreensaver-command.c b/driver/xscreensaver-command.c
index f4a855d..4a4f0b4 100644
--- a/driver/xscreensaver-command.c
+++ b/driver/xscreensaver-command.c
@@ -1,4 +1,4 @@
-/* xscreensaver-command, Copyright (c) 1991-2013 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver-command, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -51,8 +51,8 @@ char *progname;
Atom XA_VROOT;
Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_RESPONSE;
Atom XA_SCREENSAVER_ID, XA_SCREENSAVER_STATUS, XA_SELECT, XA_DEMO, XA_EXIT;
-Atom XA_BLANK, XA_LOCK;
-static Atom XA_ACTIVATE, XA_DEACTIVATE, XA_CYCLE, XA_NEXT, XA_PREV;
+Atom XA_BLANK, XA_LOCK, XA_ACTIVATE, XA_SUSPEND, XA_NEXT, XA_PREV;
+static Atom XA_DEACTIVATE, XA_CYCLE;
static Atom XA_RESTART, XA_PREFS, XA_THROTTLE, XA_UNTHROTTLE;
static char *screensaver_version;
@@ -117,6 +117,11 @@ usage: %s -<option>\n\
well, even if locking is not the default. If the saver is\n\
already active, this causes it to be locked as well.\n\
\n\
+ -suspend Like -activate, but ignores the lock-timeout, if any, and\n\
+ immediately powers off the screen without fading out.\n\
+ This is intended to be run just after your laptop's lid\n\
+ is closed, and just before the CPU halts.\n\
+\n\
-version Prints the version of xscreensaver that is currently running\n\
on the display -- that is, the actual version number of the\n\
running xscreensaver background process, rather than the\n\
@@ -187,6 +192,7 @@ main (int argc, char **argv)
else if (cmd) USAGE();
else if (!strncmp (s, "-activate", L)) cmd = &XA_ACTIVATE;
else if (!strncmp (s, "-deactivate", L)) cmd = &XA_DEACTIVATE;
+ else if (!strncmp (s, "-suspend", L)) cmd = &XA_SUSPEND;
else if (!strncmp (s, "-cycle", L)) cmd = &XA_CYCLE;
else if (!strncmp (s, "-next", L)) cmd = &XA_NEXT;
else if (!strncmp (s, "-prev", L)) cmd = &XA_PREV;
@@ -300,6 +306,7 @@ main (int argc, char **argv)
XA_SCREENSAVER_RESPONSE = XInternAtom (dpy, "_SCREENSAVER_RESPONSE", False);
XA_ACTIVATE = XInternAtom (dpy, "ACTIVATE", False);
XA_DEACTIVATE = XInternAtom (dpy, "DEACTIVATE", False);
+ XA_SUSPEND = XInternAtom (dpy, "SUSPEND", False);
XA_RESTART = XInternAtom (dpy, "RESTART", False);
XA_CYCLE = XInternAtom (dpy, "CYCLE", False);
XA_NEXT = XInternAtom (dpy, "NEXT", False);
@@ -321,7 +328,7 @@ main (int argc, char **argv)
exit (i);
}
- if (*cmd == XA_ACTIVATE || *cmd == XA_LOCK ||
+ if (*cmd == XA_ACTIVATE || *cmd == XA_LOCK || *cmd == XA_SUSPEND ||
*cmd == XA_NEXT || *cmd == XA_PREV || *cmd == XA_SELECT)
/* People never guess that KeyRelease deactivates the screen saver too,
so if we're issuing an activation command, wait a second.
diff --git a/driver/xscreensaver-command.man b/driver/xscreensaver-command.man
index 040a183..5837e5d 100644
--- a/driver/xscreensaver-command.man
+++ b/driver/xscreensaver-command.man
@@ -11,7 +11,7 @@
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "09-Nov-2013 (5.23)" "X Version 11"
+.TH XScreenSaver 1 "03-Jun-2019 (5.42)" "X Version 11"
.SH NAME
xscreensaver-command - control a running xscreensaver process
.SH SYNOPSIS
@@ -29,6 +29,7 @@ xscreensaver-command - control a running xscreensaver process
\-exit | \
\-restart | \
\-lock | \
+\-suspend | \
\-version | \
\-time | \
\-watch]
@@ -137,6 +138,12 @@ running as you. See
.BR xscreensaver (1)
for details.
.TP 8
+.B \-suspend
+Like \fI\-activate\fP, but ignores \fIlockTimeout\fP and immediately
+powers off the screen without fading out. This is intended to be run
+just after your laptop's lid is closed, and just before the CPU halts,
+to lock things down quickly.
+.TP 8
.B \-version
Prints the version of xscreensaver that is currently running on the display:
that is, the actual version number of the running xscreensaver background
@@ -249,7 +256,7 @@ and related tools can always be found at https://www.jwz.org/xscreensaver/
.BR xscreensaver\-demo (1),
.BR xset (1)
.SH COPYRIGHT
-Copyright \(co 1992-2013 by Jamie Zawinski.
+Copyright \(co 1992-2019 by Jamie Zawinski.
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that
diff --git a/driver/xscreensaver-systemd.c b/driver/xscreensaver-systemd.c
new file mode 100644
index 0000000..a46ed4d
--- /dev/null
+++ b/driver/xscreensaver-systemd.c
@@ -0,0 +1,232 @@
+/* xscreensaver-systemd, Copyright (c) 2019 Martin Lucina <martin@lucina.net>
+ *
+ * ISC License
+ *
+ * Permission to use, copy, modify, and/or distribute this software
+ * for any purpose with or without fee is hereby granted, provided
+ * that the above copyright notice and this permission notice appear
+ * in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * This is a small utility providing systemd integration for XScreenSaver.
+ *
+ * When run from ~/.xsession or equivalent, this will:
+ *
+ * - Lock the screen before the system goes to sleep (using
+ * xscreensaver-command -suspend).
+ *
+ * - Ensure the XScreenSaver password dialog is shown after the system
+ * is resumed (using xscreensaver-command -deactivate).
+ *
+ * This is implemented using the recommended way to do these things
+ * nowadays, namely inhibitor locks. sd-bus is used for DBUS communication,
+ * so the only dependency is libsystemd (which you already have if you
+ * want this).
+ *
+ * https://github.com/mato/xscreensaver-systemd
+ */
+
+#include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <systemd/sd-bus.h>
+
+struct handler_ctx {
+ sd_bus *bus;
+ sd_bus_message *lock;
+};
+static struct handler_ctx global_ctx = { NULL, NULL };
+
+static int handler(sd_bus_message *m, void *arg,
+ sd_bus_error *ret_error)
+{
+ struct handler_ctx *ctx = arg;
+ int before_sleep;
+ int rc;
+ sd_bus_error error = SD_BUS_ERROR_NULL;
+ sd_bus_message *reply = NULL;
+ int fd;
+
+ rc = sd_bus_message_read(m, "b", &before_sleep);
+ if (rc < 0) {
+ warnx("Failed to read message: %s", strerror(-rc));
+ return 0;
+ }
+
+ /* Use the scheme described at
+ * https://www.freedesktop.org/wiki/Software/systemd/inhibit/
+ * under "Taking Delay Locks".
+ */
+ if (before_sleep) {
+ rc = system("xscreensaver-command -suspend");
+ if (rc == -1) {
+ warnx("Failed to run xscreensaver-command");
+ }
+ else if (WEXITSTATUS(rc) != 0) {
+ warnx("xscreensaver-command failed with %d", WEXITSTATUS(rc));
+ }
+
+ if (ctx->lock) {
+ /*
+ * This will release the lock, since we hold the only ref to the
+ * message, and sd_bus_message_unref() will close the underlying
+ * fd.
+ */
+ sd_bus_message_unref(ctx->lock);
+ ctx->lock = NULL;
+ }
+ else {
+ warnx("Warning: ctx->lock is NULL, this should not happen?");
+ }
+ }
+ else {
+ rc = system("xscreensaver-command -deactivate");
+ if (rc == -1) {
+ warnx("Failed to run xscreensaver-command");
+ }
+ else if (WEXITSTATUS(rc) != 0) {
+ warnx("xscreensaver-command exited with %d", WEXITSTATUS(rc));
+ }
+
+ rc = sd_bus_call_method(ctx->bus,
+ "org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
+ "Inhibit",
+ &error,
+ &reply,
+ "ssss",
+ "sleep",
+ "xscreensaver",
+ "lock screen on suspend",
+ "delay");
+ if (rc < 0) {
+ warnx("Failed to call Inhibit(): %s", error.message);
+ goto out;
+ }
+ /*
+ * Verify that the reply actually contains a lock fd.
+ */
+ rc = sd_bus_message_read(reply, "h", &fd);
+ if (rc < 0) {
+ warnx("Failed to read message: %s", strerror(-rc));
+ goto out;
+ }
+ assert(fd >= 0);
+ ctx->lock = reply;
+
+out:
+ sd_bus_error_free(&error);
+ }
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ sd_bus *bus = NULL, *user_bus = NULL;
+ sd_bus_slot *slot = NULL;
+ struct handler_ctx *ctx = &global_ctx;
+ sd_bus_error error = SD_BUS_ERROR_NULL;
+ sd_bus_message *reply = NULL;
+ int rc;
+ int fd;
+ const char *match =
+ "type='signal',interface='org.freedesktop.login1.Manager'"
+ ",member='PrepareForSleep'";
+
+ rc = sd_bus_open_user(&user_bus);
+ if (rc < 0) {
+ warnx("Failed to connect to user bus: %s", strerror(-rc));
+ goto out;
+ }
+ rc = sd_bus_request_name(user_bus, "org.jwz.XScreenSaver", 0);
+ if (rc < 0) {
+ warnx("Failed to acquire well-known name: %s", strerror(-rc));
+ warnx("Is another copy of xscreensaver-systemd running?");
+ goto out;
+ }
+
+ rc = sd_bus_open_system(&bus);
+ if (rc < 0) {
+ warnx("Failed to connect to system bus: %s", strerror(-rc));
+ goto out;
+ }
+ ctx->bus = bus;
+
+ rc = sd_bus_call_method(bus,
+ "org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
+ "Inhibit",
+ &error,
+ &reply,
+ "ssss",
+ "sleep",
+ "xscreensaver",
+ "lock screen on suspend",
+ "delay");
+ if (rc < 0) {
+ warnx("Failed to call Inhibit(): %s", error.message);
+ goto out;
+ }
+ /*
+ * Verify that the reply actually contains a lock fd.
+ */
+ rc = sd_bus_message_read(reply, "h", &fd);
+ if (rc < 0) {
+ warnx("Failed to read message: %s", strerror(-rc));
+ goto out;
+ }
+ assert(fd >= 0);
+ ctx->lock = reply;
+
+ rc = sd_bus_add_match(bus, &slot, match, handler, &global_ctx);
+ if (rc < 0) {
+ warnx("Failed to add match: %s", strerror(-rc));
+ goto out;
+ }
+
+ for (;;) {
+ rc = sd_bus_process(bus, NULL);
+ if (rc < 0) {
+ warnx("Failed to process bus: %s", strerror(-rc));
+ goto out;
+ }
+ if (rc > 0)
+ /* we processed a request, try to process another one, right-away */
+ continue;
+
+ /* Wait for the next request to process */
+ rc = sd_bus_wait(bus, (uint64_t) -1);
+ if (rc < 0) {
+ warnx("Failed to wait on bus: %s", strerror(-rc));
+ goto out;
+ }
+ }
+
+out:
+ if (reply)
+ sd_bus_message_unref(reply);
+ if (slot)
+ sd_bus_slot_unref(slot);
+ if (bus)
+ sd_bus_flush_close_unref(bus);
+ if (user_bus)
+ sd_bus_flush_close_unref(user_bus);
+ sd_bus_error_free(&error);
+
+ return EXIT_FAILURE;
+}
diff --git a/driver/xscreensaver-systemd.man b/driver/xscreensaver-systemd.man
new file mode 100644
index 0000000..082cac7
--- /dev/null
+++ b/driver/xscreensaver-systemd.man
@@ -0,0 +1,49 @@
+.TH XScreenSaver 1 "4-Jun-2019 (5.43)" "X Version 11"
+.SH NAME
+xscreensaver-systemd - lock the screen when the machine suspends.
+.SH SYNOPSIS
+.B xscreensaver-systemd
+.SH DESCRIPTION
+The \fIxscreensaver\-systemd\fP program is a helper program to
+integrate xscreensaver with
+.BR systemd (1).
+When run from \fI~/.xsession\fP or equivalent, this will:
+.TP 3
+\fB1:
+Lock the screen before the system goes to sleep
+(using \fIxscreensaver-command -suspend\fP).
+.TP 3
+\fB2:
+Ensure the XScreenSaver password dialog is shown after the system
+is resumed (using \fIxscreensaver-command -deactivate\fP).
+.RS 0
+
+This is implemented using inhibitor locks;
+.BR sd-bus (3)
+is used for DBUS communication.
+.SH BUGS
+Uses libsystemd.
+.SH SEE ALSO
+.BR X (1),
+.BR xscreensaver (1),
+.BR xscreensaver\-demo (1),
+.BR xscreensaver\-command (1),
+.BR systemd (1),
+.BR sd-bus (3)
+.SH COPYRIGHT
+Copyright \(co 2019 by Martin Lucina.
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice appear
+in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.SH AUTHOR
+Martin Lucina <martin@lucina.net>, 4-Jun-2019
diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c
index df816f9..0ecb6ec 100644
--- a/driver/xscreensaver.c
+++ b/driver/xscreensaver.c
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-2018 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -241,7 +241,7 @@ XrmDatabase db = 0;
static Atom XA_SCREENSAVER_RESPONSE;
-static Atom XA_ACTIVATE, XA_DEACTIVATE, XA_CYCLE, XA_NEXT, XA_PREV;
+static Atom XA_ACTIVATE, XA_DEACTIVATE, XA_SUSPEND, XA_CYCLE, XA_NEXT, XA_PREV;
static Atom XA_RESTART, XA_SELECT;
static Atom XA_THROTTLE, XA_UNTHROTTLE;
Atom XA_DEMO, XA_PREFS, XA_EXIT, XA_LOCK, XA_BLANK;
@@ -681,6 +681,7 @@ connect_to_server (saver_info *si, int *argc, char **argv)
XA_NET_WM_USER_TIME = XInternAtom (si->dpy, "_NET_WM_USER_TIME", False);
XA_ACTIVATE = XInternAtom (si->dpy, "ACTIVATE", False);
XA_DEACTIVATE = XInternAtom (si->dpy, "DEACTIVATE", False);
+ XA_SUSPEND = XInternAtom (si->dpy, "SUSPEND", False);
XA_RESTART = XInternAtom (si->dpy, "RESTART", False);
XA_CYCLE = XInternAtom (si->dpy, "CYCLE", False);
XA_NEXT = XInternAtom (si->dpy, "NEXT", False);
@@ -1206,7 +1207,13 @@ main_loop (saver_info *si)
maybe_reload_init_file (si);
- if (p->mode == DONT_BLANK)
+ /* Treat DONT_BLANK as BLANK_ONLY in emergency-lock when locking
+ is enabled. */
+
+ if (p->mode == DONT_BLANK &&
+ (!si->emergency_lock_p ||
+ !p->lock_p ||
+ si->locking_disabled_p))
{
if (p->verbose_p)
fprintf (stderr, "%s: idle with blanking disabled at %s.\n",
@@ -1332,6 +1339,9 @@ main_loop (saver_info *si)
if (si->fading_possible_p && p->fade_p)
lock_timeout += p->fade_seconds / 1000;
+ if (si->emergency_lock_p)
+ lock_timeout = 0;
+
if (si->emergency_lock_p && p->lock_p && lock_timeout)
{
int secs = p->lock_timeout / 1000;
@@ -1458,6 +1468,11 @@ main_loop (saver_info *si)
si->lock_id = 0;
}
+# ifdef HAVE_LIBSYSTEMD
+ /* This might be a good spot to re-launch si->systemd_pid
+ if it has died unexpectedly. Which shouldn't happen. */
+# endif
+
/* Since we're unblanked now, break race conditions and make
sure we stay that way (see comment in timers.c.) */
if (! si->de_race_id)
@@ -1583,6 +1598,10 @@ main (int argc, char **argv)
initialize_stderr (si);
handle_signals (si);
+# ifdef HAVE_LIBSYSTEMD /* Launch it in the background */
+ si->systemd_pid = fork_and_exec_1 (si, 0, "xscreensaver-systemd");
+# endif
+
make_splash_dialog (si);
main_loop (si); /* doesn't return */
@@ -1839,6 +1858,11 @@ handle_clientmessage (saver_info *si, XEvent *event, Bool until_idle_p)
}
else if (type == XA_DEACTIVATE)
{
+
+ /* Regardless of whether the screen saver is active, a DEACTIVATE
+ message should cause the monitor to become powered on. */
+ monitor_power_on (si, True);
+
# if 0
/* When -deactivate is received while locked, pop up the dialog box
instead of just ignoring it. Some people depend on this behavior
@@ -1881,6 +1905,34 @@ handle_clientmessage (saver_info *si, XEvent *event, Bool until_idle_p)
reset_timers (si);
}
}
+ else if (type == XA_SUSPEND)
+ {
+ clientmessage_response(si, window, False,
+ "SUSPEND ClientMessage received.",
+ "suspending.");
+ si->selection_mode = 0;
+ si->demoing_p = False;
+ si->emergency_lock_p = True;
+ si->throttled_p = True;
+
+ /* When suspending, immediately lock, if locking enabled. */
+# ifndef NO_LOCKING
+ if (p->lock_p && !si->locked_p && !si->locking_disabled_p)
+ {
+ if (p->verbose_p)
+ fprintf (stderr, "%s: locking.\n", blurb());
+ set_locked_p (si, True);
+ }
+# endif
+
+ /* When suspending, immediately power off the display. */
+ monitor_power_on (si, False);
+
+ if (until_idle_p)
+ return True; /* Blank now */
+ else
+ return False; /* Do not unblank now */
+ }
else if (type == XA_CYCLE)
{
if (! until_idle_p)
@@ -2362,6 +2414,12 @@ analyze_display (saver_info *si)
fprintf (stderr, "%s\n", buf);
}
+# ifdef HAVE_LIBSYSTEMD
+ fprintf (stderr, "%s: libsystemd\n", blurb());
+# else
+ fprintf (stderr, "%s: libsystemd (disabled at compile time)\n", blurb());
+# endif
+
for (i = 0; i < si->nscreens; i++)
{
saver_screen_info *ssi = &si->screens[i];
diff --git a/driver/xscreensaver.h b/driver/xscreensaver.h
index 2a3ae02..fe84d20 100644
--- a/driver/xscreensaver.h
+++ b/driver/xscreensaver.h
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993-2017 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2019 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -158,8 +158,11 @@ extern void hack_subproc_environment (Screen *, Window saver_window);
extern void init_sigchld (void);
extern void spawn_screenhack (saver_screen_info *ssi);
extern pid_t fork_and_exec (saver_screen_info *ssi, const char *command);
+extern pid_t fork_and_exec_1 (saver_info *si, saver_screen_info *ssi,
+ const char *command);
extern int exec_and_wait (saver_info *si, const char *command);
extern void kill_screenhack (saver_screen_info *ssi);
+int kill_job (saver_info *si, pid_t pid, int signal);
extern void suspend_screenhack (saver_screen_info *ssi, Bool suspend_p);
extern Bool screenhack_running_p (saver_info *si);
extern void emergency_kill_subproc (saver_info *si);
diff --git a/driver/xscreensaver.man b/driver/xscreensaver.man
index a99845b..0679ff4 100644
--- a/driver/xscreensaver.man
+++ b/driver/xscreensaver.man
@@ -11,7 +11,7 @@
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "09-Nov-2013 (5.23)" "X Version 11"
+.TH XScreenSaver 1 "6-Jun-2019 (5.43)" "X Version 11"
.SH NAME
xscreensaver - extensible screen saver and screen locking framework
.SH SYNOPSIS
@@ -254,7 +254,7 @@ If that doesn't work, then try this:
Open "\fISystem Settings / Startup/Shutdown / Autostart\fP", and then
add "\fI/usr/bin/xscreensaver\fP".
-If you are lucky, that will create a \fIxscreensaver.desktop"\fP file
+If you are lucky, that will create a \fI"xscreensaver.desktop"\fP file
for you in \fI~/.config/autostart/\fP or \fI~/.kde/Autostart/\fP.
.TP 3
\fB3: Make xscreensaver be an Autostart program.\fP
@@ -369,6 +369,17 @@ X server's access control mechanisms, see the man pages for
.BR xauth (1),
and
.BR xhost (1).
+.SH LAPTOP LIDS
+If you are running a system with
+.BR systemd (1)
+221 or newer, and if xscreensaver was compiled with \fIlibsystemd\fP
+support, then closing the lid of your laptop will cause the screen to
+lock immediately.
+
+If not, then the screen might not lock until a few seconds \fIafter\fP you
+re-open the lid. Which is less than ideal. So if you don't
+use \fIsystemd\fP, you might want to get in the habit of
+doing \fIxscreensaver-command -lock\fP before closing the lid.
.SH BUGS
Bugs? There are no bugs. Ok, well, maybe. If you find one, please let
me know. https://www.jwz.org/xscreensaver/bugs.html explains how to
@@ -1016,7 +1027,7 @@ and a FAQ can always be found at https://www.jwz.org/xscreensaver/
.BR xscreensaver\-getimage (1),
.BR xscreensaver\-text (1).
.SH COPYRIGHT
-Copyright \(co 1991-2018 by Jamie Zawinski.
+Copyright \(co 1991-2019 by Jamie Zawinski.
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that