From 6a32252403781b303d4ebd195932ce39c5b1c08e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 30 Jul 2019 16:03:58 +0200 Subject: Update to 5.43 --- driver/Makefile.in | 16 +- driver/XScreenSaver.ad.in | 286 +++++++++++++++++++-------- driver/XScreenSaver_Xm_ad.h | 108 ----------- driver/XScreenSaver_ad.h | 417 ---------------------------------------- driver/demo-Gtk.c | 8 +- driver/demo-Xm.c | 3 +- driver/lock.c | 4 +- driver/remote.c | 118 +++++++++++- driver/screens.c | 4 +- driver/splash.c | 2 +- driver/subprocs.c | 24 ++- driver/types.h | 5 +- driver/windows.c | 20 +- driver/xscreensaver-command.c | 15 +- driver/xscreensaver-command.man | 11 +- driver/xscreensaver-systemd.c | 232 ++++++++++++++++++++++ driver/xscreensaver-systemd.man | 49 +++++ driver/xscreensaver.c | 64 +++++- driver/xscreensaver.h | 5 +- driver/xscreensaver.man | 17 +- 20 files changed, 771 insertions(+), 637 deletions(-) delete mode 100644 driver/XScreenSaver_Xm_ad.h delete mode 100644 driver/XScreenSaver_ad.h create mode 100644 driver/xscreensaver-systemd.c create mode 100644 driver/xscreensaver-systemd.man (limited to 'driver') 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 eec998f..5deb334 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/ @@ -55,7 +55,7 @@ *splash: True *splashDuration: 0:00:05 *visualID: default -*captureStderr: True +*installColormap: True *ignoreUninstalledPrograms: False *authWarningSlack: 20 @@ -65,12 +65,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 @@ -80,14 +84,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 @@ -124,6 +125,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: @@ -139,15 +142,195 @@ GetViewPortIsFullOfLies: False @NEW_LOGIN_COMMAND_P@*newLoginCommand: @NEW_LOGIN_COMMAND@ -! 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 +*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. ! @@ -157,6 +340,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\ @@ -390,75 +575,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 -*splash.demo.label: Settings -*splash.help.label: Help !============================================================================= ! ! Pretty names for the hacks that have unusual capitalization. +! Used by xscreensaver-demo. ! !============================================================================= @@ -483,6 +609,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 @@ -501,6 +628,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 2d7b168..0000000 --- a/driver/XScreenSaver_ad.h +++ /dev/null @@ -1,417 +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", -"*grabDesktopImages: True", -"*grabVideoFrames: False", -"*chooseRandomImages: True", -"*imageDirectory: /Library/Desktop Pictures/", -"*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: ", -"*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: firefox '%s' || mozilla '%s' || netscape '%s'", -"*manualCommand: xterm -sb -fg black -bg gray75 -T '%s manual' \ - -e /bin/sh -c 'man \"%s\" ; read foo'", -"*dateFormat: %d-%b-%y (%a); %I:%M %p", -"*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 ", -"*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 + * xscreensaver, Copyright (c) 1993-2019 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 @@ -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 +/* xscreensaver-command, Copyright (c) 1991-2019 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 @@ -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 4f327e9..d500f70 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 + * xscreensaver, Copyright (c) 1991-2019 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 @@ -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 f1630b0..35992ae 100644 --- a/driver/types.h +++ b/driver/types.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2014 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2019 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 @@ -344,6 +344,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 9b2bf84..b7bea52 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 + * xscreensaver, Copyright (c) 1991-2019 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 @@ -752,6 +752,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); } @@ -872,6 +882,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 +/* xscreensaver-command, Copyright (c) 1991-2019 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 @@ -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; @@ -116,6 +116,11 @@ usage: %s -