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 --- Makefile.in | 25 +- README | 12 + config.h.in | 6 + configure | 583 ++++- configure.in | 187 +- 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 +- hacks/bsod.c | 26 +- hacks/ccurve.c | 2 +- hacks/config/README | 4 +- hacks/config/bouncingcow.xml | 6 +- hacks/config/deepstars.xml | 29 + hacks/config/flyingtoasters.xml | 1 + hacks/config/glplanet.xml | 11 +- hacks/config/gravitywell.xml | 44 + hacks/config/hexadrop.xml | 2 +- hacks/config/imsmap.xml | 2 +- hacks/config/unknownpleasures.xml | 2 + hacks/filmleader.c | 20 +- hacks/fontglide.c | 4 +- hacks/fps.c | 45 +- hacks/fuzzyflakes.c | 8 +- hacks/glitchpeg.c | 17 +- hacks/glx/Makefile.in | 77 +- hacks/glx/bouncingcow.c | 224 +- hacks/glx/bouncingcow.man | 5 + hacks/glx/boxed.c | 2 +- hacks/glx/circuit.man | 2 +- hacks/glx/deepstars.c | 387 ++++ hacks/glx/deepstars.man | 57 + hacks/glx/esper.c | 4 +- hacks/glx/fliptext.c | 4 +- hacks/glx/flyingtoasters.c | 24 +- hacks/glx/flyingtoasters.man | 4 + hacks/glx/gears.c | 6 +- hacks/glx/glhanoi.c | 4 +- hacks/glx/glplanet.c | 206 +- hacks/glx/glplanet.man | 10 + hacks/glx/glslideshow.c | 32 +- hacks/glx/gravitywell.c | 767 +++++++ hacks/glx/gravitywell.man | 64 + hacks/glx/hypertorus.c | 4 + hacks/glx/jigsaw.c | 4 +- hacks/glx/lament.c | 2 +- hacks/glx/peepers.c | 5 +- hacks/glx/quickhull.c | 7 +- hacks/glx/sonar-icmp.c | 53 +- hacks/glx/splodesic.c | 2 +- hacks/glx/unknownpleasures.c | 120 +- hacks/glx/unknownpleasures.man | 6 + hacks/hexadrop.c | 54 +- hacks/kumppa.c | 8 +- hacks/petri.c | 11 +- hacks/shadebobs.c | 2 +- hacks/webcollage | 6 +- hacks/xjack.c | 10 +- jwxyz/jwxyz-cocoa.m | 24 +- jwxyz/jwxyz-common.c | 3 +- jwxyz/jwxyz-timers.c | 10 +- jwxyz/jwxyz.m | 4 +- jwxyz/jwzgles.c | 6 +- jwxyz/jwzglesI.h | 4 +- po/POTFILES.in | 4 +- po/ru.po | 4313 +++++++++++++++++++------------------ utils/colors.c | 6 +- utils/erase.c | 2 +- utils/font-retry.c | 53 +- utils/thread_util.c | 2 +- utils/version.h | 2 +- xscreensaver.spec | 2 +- 88 files changed, 6017 insertions(+), 3035 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 create mode 100644 hacks/config/deepstars.xml create mode 100644 hacks/config/gravitywell.xml create mode 100644 hacks/glx/deepstars.c create mode 100644 hacks/glx/deepstars.man create mode 100644 hacks/glx/gravitywell.c create mode 100644 hacks/glx/gravitywell.man diff --git a/Makefile.in b/Makefile.in index a948681..e0795b2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,8 +18,11 @@ TARFILES = README README.hacking README.VMS INSTALL \ TAR = tar -MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done -MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do (cd $$dir; $(MAKE) $@) || exit 5; done +# Using $(MAKE) directly means the shell executes things even with "make -n" +MAKE2 = $(MAKE) + +MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE2) $@) || exit 5; done +MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do (cd $$dir; $(MAKE2) $@) || exit 5; done default:: @+$(MAKE_SUBDIR) @@ -42,9 +45,9 @@ uninstall-man:: depend:: @$(MAKE_SUBDIR) distdepend:: - @$(MAKE) update_spec_version + @$(MAKE2) update_spec_version @$(MAKE_SUBDIR2) - @cd po ; $(MAKE) update-po + @cd po ; $(MAKE2) update-po TAGS:: tags tags:: @@ -64,8 +67,8 @@ tar:: @ \ sh config.status ; \ rm -f configure ; \ - $(MAKE) configure ; \ - $(MAKE) version-date distdepend ; \ + $(MAKE2) configure ; \ + $(MAKE2) version-date distdepend ; \ VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \ NAME="xscreensaver-$$VERS" ; \ rm -rf $$NAME ; ln -s . $$NAME ; \ @@ -74,7 +77,7 @@ tar:: for subdir in $(SUBDIRS2) ; do \ d=`pwd` ; \ cd $$subdir ; \ - FILES="$$FILES `$(MAKE) echo_tarfiles \ + FILES="$$FILES `$(MAKE2) echo_tarfiles \ | grep -v '^.*make\[' \ | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\" \ ` "; \ @@ -231,9 +234,9 @@ rpm:: ls -lFG xscreensaver*-$$VERS-*.rpm dmg:: - $(MAKE) -C OSX release dmg + $(MAKE2) -C OSX release dmg apk:: - $(MAKE) -C android apk + $(MAKE2) -C android apk www:: @ \ @@ -256,7 +259,7 @@ www:: exit 1 ; \ fi ; \ \ - $(MAKE) -C OSX updates.xml ; \ + $(MAKE2) -C OSX updates.xml ; \ \ if [ ! -f $$NAME ]; then \ echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \ @@ -331,7 +334,7 @@ www:: \ git add $$BNAME $$BNAME2 $$BNAME3 ; \ \ - $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \ + $(MAKE2) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \ git diff changelog.html ; \ set +x ; \ \ diff --git a/README b/README index 9a2a384..118a061 100644 --- a/README +++ b/README @@ -46,6 +46,18 @@ XScreenSaver has an extensive manual -- please read it! =============================================================================== +5.43 * New hacks, `GravityWell', `DeepStars'. + * GLPlanet now supports the Mercator projection. + * Bouncing Cow has mathematically ideal cows (spherical, frictionless). + * Foggy toasters. + * Unknown Pleasures can now use an image file as a clip mask. + * Updated `webcollage' for recent changes. + * macOS: Fixed BSOD fonts on UWQHD+ displays. + * X11: Added some sample unlock dialog color schemes to the .ad file. + * X11: On systemd systems, closing your laptop lid might actually lock + your screen now, maybe. + * X11: 'sonar' can ping without being setuid by using setcap. + 5.42 * macOS: Fixed Sparkle auto-updater. 5.41 * X11: Those new font-loading fallback heuristics work again. Oops. diff --git a/config.h.in b/config.h.in index 8c031ec..9f66b48 100644 --- a/config.h.in +++ b/config.h.in @@ -171,11 +171,17 @@ /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES +/* Define this if your system has libcap. */ +#undef HAVE_LIBCAP + /* Define this if the Portable Network Graphics library is installed. It is basically required, but many things will more-or-less limp along without it. */ #undef HAVE_LIBPNG +/* Define this if you have libsystemd. */ +#undef HAVE_LIBSYSTEMD + /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H diff --git a/configure b/configure index f61dfbe..e566796 100755 --- a/configure +++ b/configure @@ -661,6 +661,7 @@ PASSWD_OBJS PASSWD_SRCS MEN_OSX SCRIPTS_OSX +EXES_SYSTEMD EXES_OSX OBJCC COMMENT_DEMO_GLADE2_GTK_2_22_TAIL @@ -676,8 +677,12 @@ HAVE_PAM_FAIL_DELAY INSTALL_PAM NEED_SETUID INSTALL_DIRS +SETCAP_HACKS SETUID_HACKS INSTALL_SETUID +PROG_SETCAP +LIBCAP_LIBS +LIBCAP_CFLAGS PASSWD_LIBS XINERAMA_LIBS XDPMS_LIBS @@ -694,6 +699,7 @@ SAVER_LIBS ALL_DEMO_PROGRAMS PREFERRED_DEMO_PROGRAM INCLUDES +setcap_program gnome_url_show_program gnome_open_program pkg_config @@ -854,6 +860,7 @@ with_png with_pixbuf with_jpeg with_xft +with_systemd with_xshm_ext with_xdbe_ext with_readdisplay @@ -861,6 +868,7 @@ with_image_directory with_text_file with_browser with_setuid_hacks +with_setcap_hacks with_record_animation ' ac_precious_vars='build_alias @@ -1552,6 +1560,7 @@ Graphics options: GIF, JPEG, and PNG files as well. --with-jpeg Include support for the JPEG library. --with-xft Include support for the X Freetype library. + --with-systemd Build xscreensaver-systemd to lock on suspend. --with-xshm-ext Include support for the Shared Memory extension. --with-xdbe-ext Include support for the DOUBLE-BUFFER extension. --with-readdisplay Include support for the XReadDisplay extension. @@ -1561,10 +1570,10 @@ Graphics options: --with-browser=BROWSER Specify the web browser used to show the help URL. --with-setuid-hacks Allow some demos to be installed `setuid root' (which is needed in order to ping other hosts.) - + --with-setcap-hacks Allow some demos to be installed with setcap + (which is needed in order to ping other hosts.) --with-record-animation Include code for generating MP4 videos. - Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -1740,6 +1749,43 @@ fi } # ac_fn_c_try_link +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes @@ -1782,43 +1828,6 @@ fi } # ac_fn_c_try_run -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -2625,6 +2634,10 @@ echo "command line was: $0 $@" + + + + @@ -4376,27 +4389,15 @@ $as_echo "Solaris: adding -D__EXTENSIONS__" >&6; } OBJCC="$CC" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler works on ANSI C" >&5 -$as_echo_n "checking whether the compiler works on ANSI C... " >&6; } - if test "$cross_compiling" = yes; then : - as_fn_error $? "Couldn't build even a trivial ANSI C program: check CC." "$LINENO" 5 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - main(int ac, char **av) { return 0; } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Couldn't build even a trivial ANSI C program: check CC." "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - + # This test makes cross-compiling fail, so let's just assume that nobody + # is using a K&R compiler any more... + # +# AC_MSG_CHECKING([whether the compiler works on ANSI C]) +# AC_TRY_RUN([ main(int ac, char **av) { return 0; } ], +# AC_MSG_RESULT(yes), +# AC_MSG_RESULT(no) +# AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.), +# AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.)) if test -n "$GCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Turning on gcc compiler warnings." >&5 @@ -13410,7 +13411,7 @@ if ${ac_cv_mesagl_version_string+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext < #ifndef MESA_MAJOR_VERSION @@ -15017,6 +15018,219 @@ else fi +############################################################################### +# +# Check for -lsystemd +# +############################################################################### + +have_systemd=no +with_systemd_req=unspecified +systemd_halfassed=no + +# Check whether --with-systemd was given. +if test "${with_systemd+set}" = set; then : + withval=$with_systemd; with_systemd="$withval"; with_systemd_req="$withval" +else + with_systemd=yes +fi + + + + case "$with_systemd" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd headers" >&5 +$as_echo_n "checking for systemd headers... " >&6; } + d=$with_systemd/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd libs" >&5 +$as_echo_n "checking for systemd libs... " >&6; } + d=$with_systemd/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + with_systemd_req="yes" + with_systemd=$with_systemd_req + ;; + + *) + echo "" + echo "error: argument to --with-systemd must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + +if test "$with_systemd" != yes -a "$with_systemd" != no ; then + echo "error: must be yes or no: --with-systemd=$with_systemd" + exit 1 +fi + +if test "$with_systemd" = yes; then + + pkgs='' + ok="yes" + pkg_check_version libsystemd 221 + have_systemd="$ok" + + if test "$have_systemd" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd includes" >&5 +$as_echo_n "checking for libsystemd includes... " >&6; } +if ${ac_cv_systemd_config_cflags+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_systemd_config_cflags=`$pkg_config --cflags $pkgs` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_systemd_config_cflags" >&5 +$as_echo "$ac_cv_systemd_config_cflags" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd libs" >&5 +$as_echo_n "checking for libsystemd libs... " >&6; } +if ${ac_cv_systemd_config_libs+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_systemd_config_libs=`$pkg_config --libs $pkgs` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_systemd_config_libs" >&5 +$as_echo "$ac_cv_systemd_config_libs" >&6; } + fi + + ac_systemd_config_cflags=$ac_cv_systemd_config_cflags + ac_systemd_config_libs=$ac_cv_systemd_config_libs + + if test "$have_systemd" = yes; then + # + # we appear to have libsystemd; check for headers/libs to be sure. + # + ac_save_systemd_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_systemd_config_cflags" + + have_systemd=no + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-bus.h" "ac_cv_header_systemd_sd_bus_h" "$ac_includes_default" +if test "x$ac_cv_header_systemd_sd_bus_h" = xyes; then : + have_systemd=yes +fi + + + CPPFLAGS="$ac_save_CPPFLAGS" + + CPPFLAGS="$ac_save_systemd_CPPFLAGS" + fi + + if test "$have_systemd" = yes; then + # we have the headers, now check for the libraries + have_systemd=no + systemd_halfassed=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for libsystemd usability..." >&5 +$as_echo "checking for libsystemd usability..." >&6; } + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sd_bus_open_system in -lc" >&5 +$as_echo_n "checking for sd_bus_open_system in -lc... " >&6; } +if ${ac_cv_lib_c_sd_bus_open_system+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $ac_systemd_config_libs -lX11 -lXext -lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sd_bus_open_system (); +int +main () +{ +return sd_bus_open_system (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_sd_bus_open_system=yes +else + ac_cv_lib_c_sd_bus_open_system=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_sd_bus_open_system" >&5 +$as_echo "$ac_cv_lib_c_sd_bus_open_system" >&6; } +if test "x$ac_cv_lib_c_sd_bus_open_system" = xyes; then : + have_systemd=yes +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi + + if test "$have_systemd" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for libsystemd usability... no" >&5 +$as_echo "checking for libsystemd usability... no" >&6; } + fi +fi + +if test "$have_systemd" = yes; then + INCLUDES="$INCLUDES $ac_systemd_config_cflags" + EXES_SYSTEMD='$(EXES_SYSTEMD)' + $as_echo "#define HAVE_LIBSYSTEMD 1" >>confdefs.h + +else + EXES_SYSTEMD='' +fi + + ############################################################################### # # Check for pty support: this allows 'phosphor' and 'apple2' @@ -15835,6 +16049,207 @@ elif test "$setuid_hacks" != no; then fi +############################################################################### +# +# Check for setcap, which is less worrying than setuid. +# +############################################################################### + +have_libcap=no +setcap_hacks_default=yes +setcap_hacks="$setcap_hacks_default" +setcap_hacks_req=unspecified + +# Check whether --with-setcap-hacks was given. +if test "${with_setcap_hacks+set}" = set; then : + withval=$with_setcap_hacks; setcap_hacks="$withval"; setcap_hacks_req="$withval" +else + setcap_hacks=yes +fi + + + + case "$setcap_hacks" in + yes) ;; + no) ;; + + /*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setcap hacks headers" >&5 +$as_echo_n "checking for setcap hacks headers... " >&6; } + d=$setcap_hacks/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setcap hacks libs" >&5 +$as_echo_n "checking for setcap hacks libs... " >&6; } + d=$setcap_hacks/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found ($d: no such directory)" >&5 +$as_echo "not found ($d: no such directory)" >&6; } + fi + + # replace the directory string with "yes". + setcap_hacks_req="yes" + setcap_hacks=$setcap_hacks_req + ;; + + *) + echo "" + echo "error: argument to --with-setcap-hacks must be \"yes\", \"no\", or a directory." + echo " If it is a directory, then \`DIR/include' will be added to" + echo " the -I list, and \`DIR/lib' will be added to the -L list." + exit 1 + ;; + esac + + +if test "$setcap_hacks" != yes -a "$setcap_hacks" != no ; then + echo "error: must be yes or no: --with-setcap-hacks=$setcap_hacks" + exit 1 +fi + +if test "$setcap_hacks" = yes; then + + for ac_prog in setcap +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_setcap_program+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$setcap_program"; then + ac_cv_prog_setcap_program="$setcap_program" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_setcap_program="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +setcap_program=$ac_cv_prog_setcap_program +if test -n "$setcap_program"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $setcap_program" >&5 +$as_echo "$setcap_program" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$setcap_program" && break +done + + if test "$setcap_program" != ''; then + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_capability_h" = xyes; then : + have_setcap=yes +fi + + + CPPFLAGS="$ac_save_CPPFLAGS" + fi + if test "$have_setcap" = yes; then + + ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_LDFLAGS="$LDFLAGS" +# ac_save_LIBS="$LIBS" + + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + # note: $X_CFLAGS includes $x_includes + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + + if test \! -z "$libdir" ; then + LDFLAGS="$LDFLAGS -L$libdir" + fi + # note: $X_LIBS includes $x_libraries + LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" + + CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` + LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_set_flag in -lcap" >&5 +$as_echo_n "checking for cap_set_flag in -lcap... " >&6; } +if ${ac_cv_lib_cap_cap_set_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cap_set_flag (); +int +main () +{ +return cap_set_flag (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cap_cap_set_flag=yes +else + ac_cv_lib_cap_cap_set_flag=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_set_flag" >&5 +$as_echo "$ac_cv_lib_cap_cap_set_flag" >&6; } +if test "x$ac_cv_lib_cap_cap_set_flag" = xyes; then : + have_libcap=yes + PROG_SETCAP="$setcap_program" + LIBCAP_LIBS="-lcap" + $as_echo "#define HAVE_LIBCAP 1" >>confdefs.h + +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi +fi + + ############################################################################### # # Check for --with-record-animation @@ -16005,6 +16420,12 @@ else SETUID_HACKS=no fi +if test "$have_libcap" = yes; then + SETCAP_HACKS=yes +else + SETCAP_HACKS=no +fi + tab=' ' if test "$have_gl" = yes; then GL_EXES='$(GL_EXES)' @@ -16159,6 +16580,11 @@ INCLUDES=`echo "$INCLUDES" | sed 's@ -I${prefix}/include@@g;'` + + + + + @@ -17831,6 +18257,37 @@ if test "$have_xft" = no ; then fi +if test "$have_systemd" = no ; then + systemd_warned=no + if test "$with_systemd_req" = yes ; then + warnL "Use of systemd was requested, but it was not found." + systemd_warned=yes + elif test "$with_systemd_req" = no ; then + true + # noteL 'The systemd library is not being used.' + # systemd_warned=yes + else + true + # noteL "The systemd library was not found." + # systemd_warned=yes + fi + + if test "$systemd_halfassed" = yes ; then + echo '' + warn2 'More specifically, we found the headers, but not the' + warn2 'libraries; so either systemd is half-installed on this' + warn2 "system, or something else went wrong. The \`config.log'" + warn2 'file might contain some clues.' + echo '' + systemd_warned=yes + fi + + if test "$systemd_warned" = yes; then + warn2 "This means that xscreensaver-systemd won't be built." + fi +fi + + if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then preferred_mesagl=3.4 mgv="$ac_mesagl_version_string" @@ -17930,6 +18387,10 @@ if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then warn 'Use of shadow passwords was requested, but they were not found.' fi +if test "$setcap_hacks_req" = yes -a "$have_libcap" = no ; then + warn 'Use of libcap was requested, but it was not found.' +fi + if test "$ac_macosx" = yes ; then if test "$enable_locking" = yes ; then warn "You have specified --enable-locking on MacOS X." diff --git a/configure.in b/configure.in index f8ed25e..20fb0f7 100644 --- a/configure.in +++ b/configure.in @@ -181,6 +181,9 @@ AH_TEMPLATE([HAVE_XUTF8DRAWSTRING], AH_TEMPLATE([HAVE_XFT], [Define this if you have libXft2.]) +AH_TEMPLATE([HAVE_LIBSYSTEMD], + [Define this if you have libsystemd.]) + AH_TEMPLATE([HAVE_GL], [Define this if you have OpenGL. Some of the demos require it, so if you don't have it, then those particular demos won't be @@ -329,6 +332,9 @@ AH_TEMPLATE([XPointer], AH_TEMPLATE([HAVE_PTHREAD], [Define this if your system supports POSIX threads.]) +AH_TEMPLATE([HAVE_LIBCAP], + [Define this if your system has libcap.]) + AH_TEMPLATE([HAVE_RECORD_ANIM], [Define this to enable recording of videos.]) @@ -427,12 +433,15 @@ AC_DEFUN([AC_PROG_CC_ANSI], OBJCC="$CC" - AC_MSG_CHECKING([whether the compiler works on ANSI C]) - AC_TRY_RUN([ main(int ac, char **av) { return 0; } ], - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.), - AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.)) + # This test makes cross-compiling fail, so let's just assume that nobody + # is using a K&R compiler any more... + # +# AC_MSG_CHECKING([whether the compiler works on ANSI C]) +# AC_TRY_RUN([ main(int ac, char **av) { return 0; } ], +# AC_MSG_RESULT(yes), +# AC_MSG_RESULT(no) +# AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.), +# AC_MSG_ERROR(Couldn't build even a trivial ANSI C program: check CC.)) if test -n "$GCC"; then AC_MSG_RESULT(Turning on gcc compiler warnings.) @@ -3561,6 +3570,81 @@ else fi +############################################################################### +# +# Check for -lsystemd +# +############################################################################### + +have_systemd=no +with_systemd_req=unspecified +systemd_halfassed=no +AC_ARG_WITH(systemd, +[ --with-systemd Build xscreensaver-systemd to lock on suspend.], + [with_systemd="$withval"; with_systemd_req="$withval"], + [with_systemd=yes]) + +HANDLE_X_PATH_ARG(with_systemd, --with-systemd, systemd) + +if test "$with_systemd" != yes -a "$with_systemd" != no ; then + echo "error: must be yes or no: --with-systemd=$with_systemd" + exit 1 +fi + +if test "$with_systemd" = yes; then + + pkgs='' + ok="yes" + pkg_check_version libsystemd 221 + have_systemd="$ok" + + if test "$have_systemd" = yes; then + AC_CACHE_CHECK([for libsystemd includes], ac_cv_systemd_config_cflags, + [ac_cv_systemd_config_cflags=`$pkg_config --cflags $pkgs`]) + AC_CACHE_CHECK([for libsystemd libs], ac_cv_systemd_config_libs, + [ac_cv_systemd_config_libs=`$pkg_config --libs $pkgs`]) + fi + + ac_systemd_config_cflags=$ac_cv_systemd_config_cflags + ac_systemd_config_libs=$ac_cv_systemd_config_libs + + if test "$have_systemd" = yes; then + # + # we appear to have libsystemd; check for headers/libs to be sure. + # + ac_save_systemd_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $ac_systemd_config_cflags" + + have_systemd=no + AC_CHECK_X_HEADER(systemd/sd-bus.h, [have_systemd=yes]) + + CPPFLAGS="$ac_save_systemd_CPPFLAGS" + fi + + if test "$have_systemd" = yes; then + # we have the headers, now check for the libraries + have_systemd=no + systemd_halfassed=yes + + AC_MSG_RESULT(checking for libsystemd usability...) + AC_CHECK_X_LIB(c, sd_bus_open_system, [have_systemd=yes],, + $ac_systemd_config_libs -lX11 -lXext -lm) + fi + + if test "$have_systemd" = no; then + AC_MSG_RESULT(checking for libsystemd usability... no) + fi +fi + +if test "$have_systemd" = yes; then + INCLUDES="$INCLUDES $ac_systemd_config_cflags" + EXES_SYSTEMD='$(EXES_SYSTEMD)' + AC_DEFINE(HAVE_LIBSYSTEMD) +else + EXES_SYSTEMD='' +fi + + ############################################################################### # # Check for pty support: this allows 'phosphor' and 'apple2' @@ -3885,8 +3969,7 @@ setuid_hacks_default=no setuid_hacks="$setuid_hacks_default" AC_ARG_WITH(setuid-hacks, [ --with-setuid-hacks Allow some demos to be installed `setuid root' - (which is needed in order to ping other hosts.) -], + (which is needed in order to ping other hosts.)], [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"]) HANDLE_X_PATH_ARG(setuid_hacks, --with-setuid-hacks, setuid hacks) @@ -3899,6 +3982,45 @@ elif test "$setuid_hacks" != no; then fi +############################################################################### +# +# Check for setcap, which is less worrying than setuid. +# +############################################################################### + +have_libcap=no +setcap_hacks_default=yes +setcap_hacks="$setcap_hacks_default" +setcap_hacks_req=unspecified +AC_ARG_WITH(setcap-hacks, +[ --with-setcap-hacks Allow some demos to be installed with setcap + (which is needed in order to ping other hosts.)], + [setcap_hacks="$withval"; setcap_hacks_req="$withval"], + [setcap_hacks=yes]) + +HANDLE_X_PATH_ARG(setcap_hacks, --with-setcap-hacks, setcap hacks) + +if test "$setcap_hacks" != yes -a "$setcap_hacks" != no ; then + echo "error: must be yes or no: --with-setcap-hacks=$setcap_hacks" + exit 1 +fi + +if test "$setcap_hacks" = yes; then + + AC_CHECK_PROGS(setcap_program, setcap) + if test "$setcap_program" != ''; then + AC_CHECK_X_HEADER(sys/capability.h, [have_setcap=yes]) + fi + if test "$have_setcap" = yes; then + AC_CHECK_X_LIB(cap, cap_set_flag, + [have_libcap=yes + PROG_SETCAP="$setcap_program" + LIBCAP_LIBS="-lcap" + AC_DEFINE(HAVE_LIBCAP)]) + fi +fi + + ############################################################################### # # Check for --with-record-animation @@ -3908,8 +4030,7 @@ fi record_anim_default=no record_anim="$record_anim_default" AC_ARG_WITH(record-animation, -[ --with-record-animation Include code for generating MP4 videos. -], +[ --with-record-animation Include code for generating MP4 videos.], [record_anim="$withval"], [record_anim="$record_anim_default"]) HANDLE_X_PATH_ARG(record_anim, --with-record-animation, record animation) @@ -4020,6 +4141,12 @@ else SETUID_HACKS=no fi +if test "$have_libcap" = yes; then + SETCAP_HACKS=yes +else + SETCAP_HACKS=no +fi + tab=' ' if test "$have_gl" = yes; then GL_EXES='$(GL_EXES)' @@ -4121,8 +4248,12 @@ AC_SUBST(GLE_LIBS) AC_SUBST(XDPMS_LIBS) AC_SUBST(XINERAMA_LIBS) AC_SUBST(PASSWD_LIBS) +AC_SUBST(LIBCAP_CFLAGS) +AC_SUBST(LIBCAP_LIBS) +AC_SUBST(PROG_SETCAP) AC_SUBST(INSTALL_SETUID) AC_SUBST(SETUID_HACKS) +AC_SUBST(SETCAP_HACKS) AC_SUBST(INSTALL_DIRS) AC_SUBST(NEED_SETUID) AC_SUBST(INSTALL_PAM) @@ -4140,6 +4271,7 @@ AC_SUBST(COMMENT_DEMO_GLADE2_GTK_2_22_TAIL) AC_SUBST(OBJCC) AC_SUBST(EXES_OSX) +AC_SUBST(EXES_SYSTEMD) AC_SUBST(SCRIPTS_OSX) AC_SUBST(MEN_OSX) @@ -4520,6 +4652,37 @@ if test "$have_xft" = no ; then fi +if test "$have_systemd" = no ; then + systemd_warned=no + if test "$with_systemd_req" = yes ; then + warnL "Use of systemd was requested, but it was not found." + systemd_warned=yes + elif test "$with_systemd_req" = no ; then + true + # noteL 'The systemd library is not being used.' + # systemd_warned=yes + else + true + # noteL "The systemd library was not found." + # systemd_warned=yes + fi + + if test "$systemd_halfassed" = yes ; then + echo '' + warn2 'More specifically, we found the headers, but not the' + warn2 'libraries; so either systemd is half-installed on this' + warn2 "system, or something else went wrong. The \`config.log'" + warn2 'file might contain some clues.' + echo '' + systemd_warned=yes + fi + + if test "$systemd_warned" = yes; then + warn2 "This means that xscreensaver-systemd won't be built." + fi +fi + + if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then preferred_mesagl=3.4 mgv="$ac_mesagl_version_string" @@ -4619,6 +4782,10 @@ if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then warn 'Use of shadow passwords was requested, but they were not found.' fi +if test "$setcap_hacks_req" = yes -a "$have_libcap" = no ; then + warn 'Use of libcap was requested, but it was not found.' +fi + if test "$ac_macosx" = yes ; then if test "$enable_locking" = yes ; then warn "You have specified --enable-locking on MacOS X." 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 -