From 9c9d475ff889ed8be02e8ce8c17da28b93278fca Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 2 Mar 2009 00:43:18 -0500 Subject: [PATCH] http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.16.tar.gz -rw-r--r-- 1 zblaxell zblaxell 4211337 May 17 2004 xscreensaver-4.16.tar.gz de26823e5c8f9a111d2e8b9b0173c81a5813a5e1 xscreensaver-4.16.tar.gz --- Makefile.in | 19 +- README | 20 +- config.h.in | 12 + configure | 501 ++- configure.in | 97 +- driver/Makefile.in | 22 +- driver/XScreenSaver.ad.in | 21 +- driver/XScreenSaver_ad.h | 14 +- driver/demo-Gtk-conf.c | 91 +- driver/lock.c | 2 +- driver/passwd-kerberos.c | 9 +- driver/passwd.c | 2 +- driver/prefs.c | 8 +- driver/prefs.h | 4 +- driver/test-fade.c | 6 +- driver/test-grab.c | 6 +- driver/test-passwd.c | 8 +- driver/test-randr.c | 267 ++ driver/test-vp.c | 185 + driver/timers.c | 42 +- driver/windows.c | 252 +- driver/xscreensaver-command.man | 2 +- driver/xscreensaver-demo.man | 2 +- driver/xscreensaver-getimage-file | 36 +- driver/xscreensaver-getimage-file.man | 2 +- driver/xscreensaver-getimage-video.man | 2 +- driver/xscreensaver-getimage.c | 5 +- driver/xscreensaver-getimage.man | 2 +- driver/xscreensaver.c | 14 + driver/xscreensaver.h | 10 +- driver/xscreensaver.man | 2 +- driver/xset.c | 35 +- hacks/Makefile.in | 17 +- hacks/analogtv.c | 2 +- hacks/analogtv.h | 2 +- hacks/apple2-main.c | 7 +- hacks/apple2.c | 2 +- hacks/apple2.h | 2 +- hacks/apple2.man | 8 +- hacks/bsod.c | 77 +- hacks/bsod.man | 12 +- hacks/compile_axp.com | 1 + hacks/compile_decc.com | 1 + hacks/config/README | 4 +- hacks/config/anemone.xml | 2 +- hacks/config/ant.xml | 2 +- hacks/config/antinspect.xml | 20 + hacks/config/antspotlight.xml | 2 +- hacks/config/apollonian.xml | 2 +- hacks/config/attraction.xml | 2 +- hacks/config/atunnel.xml | 2 +- hacks/config/barcode.xml | 2 +- hacks/config/blaster.xml | 2 +- hacks/config/blinkbox.xml | 2 +- hacks/config/blocktube.xml | 2 +- hacks/config/bouboule.xml | 2 +- hacks/config/boxed.xml | 7 +- hacks/config/braid.xml | 2 +- hacks/config/bsod.xml | 3 +- hacks/config/bubble3d.xml | 2 +- hacks/config/bubbles.xml | 2 +- hacks/config/bumps.xml | 2 +- hacks/config/cage.xml | 2 +- hacks/config/ccurve.xml | 4 +- hacks/config/circuit.xml | 8 +- hacks/config/cloudlife.xml | 2 +- hacks/config/compass.xml | 2 +- hacks/config/coral.xml | 2 +- hacks/config/critical.xml | 2 +- hacks/config/crystal.xml | 2 +- hacks/config/cubenetic.xml | 2 +- hacks/config/cubestorm.xml | 4 +- hacks/config/cynosure.xml | 2 +- hacks/config/dangerball.xml | 2 +- hacks/config/decayscreen.xml | 2 +- hacks/config/deco.xml | 2 +- hacks/config/deluxe.xml | 2 +- hacks/config/demon.xml | 2 +- hacks/config/discrete.xml | 2 +- hacks/config/distort.xml | 2 +- hacks/config/drift.xml | 2 +- hacks/config/endgame.xml | 2 +- hacks/config/engine.xml | 22 +- hacks/config/epicycle.xml | 2 +- hacks/config/eruption.xml | 2 +- hacks/config/euler2d.xml | 2 +- hacks/config/extrusion.xml | 2 +- hacks/config/fadeplot.xml | 2 +- hacks/config/flag.xml | 2 +- hacks/config/flame.xml | 2 +- hacks/config/flipflop.xml | 2 +- hacks/config/flipscreen3d.xml | 2 +- hacks/config/flow.xml | 2 +- hacks/config/fluidballs.xml | 2 +- hacks/config/forest.xml | 2 +- hacks/config/fuzzyflakes.xml | 41 + hacks/config/galaxy.xml | 2 +- hacks/config/gears.xml | 2 +- hacks/config/gflux.xml | 2 +- hacks/config/glblur.xml | 2 +- hacks/config/glforestfire.xml | 4 +- hacks/config/glknots.xml | 4 +- hacks/config/glplanet.xml | 2 +- hacks/config/glslideshow.xml | 2 +- hacks/config/gltext.xml | 2 +- hacks/config/goop.xml | 2 +- hacks/config/grav.xml | 2 +- hacks/config/greynetic.xml | 2 +- hacks/config/halo.xml | 2 +- hacks/config/helix.xml | 2 +- hacks/config/hopalong.xml | 2 +- hacks/config/hyperball.xml | 2 +- hacks/config/hypercube.xml | 2 +- hacks/config/hypertorus.xml | 2 +- hacks/config/ifs.xml | 2 +- hacks/config/imsmap.xml | 2 +- hacks/config/interference.xml | 2 +- hacks/config/jigsaw.xml | 2 +- hacks/config/juggle.xml | 2 +- hacks/config/julia.xml | 2 +- hacks/config/kaleidescope.xml | 2 +- hacks/config/klein.xml | 52 +- hacks/config/kumppa.xml | 2 +- hacks/config/lament.xml | 2 +- hacks/config/laser.xml | 2 +- hacks/config/lightning.xml | 2 +- hacks/config/lisa.xml | 2 +- hacks/config/lissie.xml | 2 +- hacks/config/lmorph.xml | 2 +- hacks/config/loop.xml | 2 +- hacks/config/maze.xml | 2 +- hacks/config/menger.xml | 2 +- hacks/config/metaballs.xml | 2 +- hacks/config/mirrorblob.xml | 2 +- hacks/config/mismunch.xml | 2 +- hacks/config/moebius.xml | 2 +- hacks/config/moire.xml | 2 +- hacks/config/moire2.xml | 2 +- hacks/config/molecule.xml | 4 +- hacks/config/morph3d.xml | 2 +- hacks/config/mountain.xml | 2 +- hacks/config/munch.xml | 2 +- hacks/config/nerverot.xml | 2 +- hacks/config/noof.xml | 2 +- hacks/config/pacman.xml | 2 +- hacks/config/pedal.xml | 2 +- hacks/config/penrose.xml | 2 +- hacks/config/petri.xml | 2 +- hacks/config/phosphor.xml | 2 +- hacks/config/piecewise.xml | 2 +- hacks/config/pipes.xml | 2 +- hacks/config/polyhedra.xml | 200 + hacks/config/polyominoes.xml | 2 +- hacks/config/polytopes.xml | 2 +- hacks/config/popsquares.xml | 2 +- hacks/config/providence.xml | 21 + hacks/config/pulsar.xml | 2 +- hacks/config/pyro.xml | 2 +- hacks/config/qix.xml | 2 +- hacks/config/queens.xml | 2 +- hacks/config/rd-bomb.xml | 2 +- hacks/config/ripples.xml | 2 +- hacks/config/rocks.xml | 4 +- hacks/config/rorschach.xml | 2 +- hacks/config/rotor.xml | 2 +- hacks/config/rotzoomer.xml | 2 +- hacks/config/rubik.xml | 2 +- hacks/config/sballs.xml | 4 +- hacks/config/shadebobs.xml | 2 +- hacks/config/sierpinski.xml | 2 +- hacks/config/sierpinski3d.xml | 2 +- hacks/config/slidescreen.xml | 2 +- hacks/config/slip.xml | 2 +- hacks/config/sonar.xml | 30 +- hacks/config/speedmine.xml | 2 +- hacks/config/sphere.xml | 2 +- ...{sphereEversion.xml => sphereeversion.xml} | 0 hacks/config/spheremonics.xml | 2 +- hacks/config/spiral.xml | 2 +- hacks/config/spotlight.xml | 2 +- hacks/config/sproingies.xml | 2 +- hacks/config/squiral.xml | 2 +- hacks/config/stairs.xml | 2 +- hacks/config/starfish.xml | 2 +- hacks/config/starwars.xml | 4 +- hacks/config/strange.xml | 2 +- hacks/config/superquadrics.xml | 2 +- hacks/config/swirl.xml | 2 +- hacks/config/t3d.xml | 2 +- hacks/config/thornbird.xml | 2 +- hacks/config/triangle.xml | 2 +- hacks/config/truchet.xml | 2 +- hacks/config/twang.xml | 2 +- hacks/config/vidwhacker.xml | 2 +- hacks/config/vines.xml | 2 +- hacks/config/wander.xml | 2 +- hacks/config/webcollage.xml | 2 +- hacks/config/worm.xml | 2 +- hacks/config/wormhole.xml | 2 +- hacks/config/xaos.xml | 1 - hacks/config/xfishtank.xml | 4 +- hacks/config/xflame.xml | 2 +- hacks/config/xjack.xml | 2 +- hacks/config/xmatrix.xml | 2 +- hacks/config/xmountains.xml | 121 +- hacks/config/xplanet.xml | 6 +- hacks/config/xrayswarm.xml | 2 +- hacks/config/xspirograph.xml | 2 +- hacks/config/zoom.xml | 2 +- hacks/fuzzyflakes.c | 262 ++ hacks/fuzzyflakes.man | 91 + hacks/glx/Makefile.in | 36 +- hacks/glx/antinspect.c | 662 +++ hacks/glx/antinspect.man | 58 + hacks/glx/ants.h | 6 +- hacks/glx/antspotlight.c | 18 +- hacks/glx/antspotlight.man | 7 +- hacks/glx/atlantis.c | 6 +- hacks/glx/bouncingcow.c | 2 +- hacks/glx/circuit.man | 8 +- hacks/glx/cubenetic.c | 2 +- hacks/glx/cubestorm.c | 2 +- hacks/glx/dangerball.c | 2 +- hacks/glx/endgame.c | 249 +- hacks/glx/endgame.man | 8 +- hacks/glx/engine.c | 7 +- hacks/glx/flyingtoasters.c | 2 +- hacks/glx/gflux.man | 2 +- hacks/glx/glblur.c | 2 +- hacks/glx/glknots.c | 2 +- hacks/glx/glmatrix.c | 2 +- hacks/glx/glslideshow.c | 5 +- hacks/glx/gltext.c | 30 +- hacks/glx/lament.c | 2 +- hacks/glx/lavalite.c | 2 +- hacks/glx/menger.c | 2 +- hacks/glx/mirrorblob.c | 8 +- hacks/glx/molecule.c | 81 +- hacks/glx/molecule.man | 2 +- hacks/glx/noof.c | 31 +- hacks/glx/polyhedra-gl.c | 757 ++++ hacks/glx/polyhedra.c | 2444 +++++++++++ hacks/glx/polyhedra.h | 52 + hacks/glx/polyhedra.man | 123 + hacks/glx/providence.c | 793 ++++ hacks/glx/providence.man | 58 + hacks/glx/spheremonics.c | 2 +- hacks/glx/starwars.c | 26 + hacks/glx/starwars.man | 2 +- hacks/images/matrix1.xbm | 171 +- hacks/images/matrix1.xpm | 58 +- hacks/images/matrix1b.xbm | 43 +- hacks/images/matrix1b.xpm | 28 +- hacks/images/matrix2.xbm | 2463 ++++++----- hacks/images/matrix2.xpm | 58 +- hacks/images/matrix2b.xbm | 49 +- hacks/images/matrix2b.xpm | 28 +- hacks/images/matrix3.xpm | 1338 +++--- hacks/phosphor.c | 7 +- hacks/phosphor.man | 3 +- hacks/pong.c | 6 - hacks/pong.man | 7 +- hacks/sonar.c | 168 +- hacks/webcollage | 297 +- hacks/webcollage-helper.c | 117 +- hacks/webcollage.man | 37 +- po/POTFILES.in | 7 +- po/ca.po | 1812 ++++++-- po/da.po | 1952 ++++++--- po/es.po | 1945 ++++++--- po/et.po | 1823 ++++++-- po/fi.po | 1812 ++++++-- po/fr.po | 1070 +++-- po/hu.po | 1886 ++++++--- po/it.po | 1812 ++++++-- po/ja.po | 3668 ++++++++++++---- po/ko.po | 3675 +++++++++++++---- po/nl.po | 2169 +++++++--- po/no.po | 1899 ++++++--- po/pl.po | 1935 ++++++--- po/pt.po | 1943 ++++++--- po/pt_BR.po | 1812 ++++++-- po/ru.po | 3635 ++++++++++++---- po/sk.po | 1879 ++++++--- po/sv.po | 1926 ++++++--- po/vi.po | 3617 ++++++++++++---- po/wa.po | 1890 ++++++--- po/zh_CN.po | 1895 ++++++--- po/zh_TW.po | 1883 ++++++--- setup.com | 1 + utils/Makefile.in | 2 +- utils/version.h | 2 +- xscreensaver.lsm | 18 +- xscreensaver.lsm.sh | 2 +- xscreensaver.spec | 6 +- 295 files changed, 46940 insertions(+), 14457 deletions(-) create mode 100644 driver/test-randr.c create mode 100644 driver/test-vp.c create mode 100644 hacks/config/antinspect.xml create mode 100644 hacks/config/fuzzyflakes.xml create mode 100644 hacks/config/polyhedra.xml create mode 100644 hacks/config/providence.xml rename hacks/config/{sphereEversion.xml => sphereeversion.xml} (100%) create mode 100644 hacks/fuzzyflakes.c create mode 100644 hacks/fuzzyflakes.man create mode 100644 hacks/glx/antinspect.c create mode 100644 hacks/glx/antinspect.man create mode 100644 hacks/glx/polyhedra-gl.c create mode 100644 hacks/glx/polyhedra.c create mode 100644 hacks/glx/polyhedra.h create mode 100644 hacks/glx/polyhedra.man create mode 100644 hacks/glx/providence.c create mode 100644 hacks/glx/providence.man diff --git a/Makefile.in b/Makefile.in index 67c88cfc..58bf11db 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in --- xscreensaver, Copyright (c) 1999 Jamie Zawinski. +# Makefile.in --- xscreensaver, Copyright (c) 1999-2004 Jamie Zawinski. # the `../configure' script generates `Makefile' from this file. @SET_MAKE@ @@ -312,6 +312,23 @@ www:: \ cvs commit -m "$$VERS" +check_years:: + @for file in `find . -name '*.*' \ + \! -name '*~' \! -name '*.o' \! -name '*.gz' \! -name '*.Z' \ + \! -name '*.po' \! -name 'config.*' \! -name '*.glade*' \ + \! -name '*.m4' \! -name '*.pdb' \! -name '*.xpm' \ + \! -name '*.jpg' \! -name '*.gif' \! -name '*.eps' \ + \! -name '*.png' \! -name '*.tif' \! -name '*.bak' \ + | sort` \ + ; do \ + y=`date -r "$$file" '+%Y'` ; \ + if ! ( grep "\b$$y\b" $$file >/dev/null ); then \ + if ( grep "opyright\|(c)\|\.BR" $$file >/dev/null ); then \ + echo "$$file does not mention $$y" ; \ + fi ; \ + fi ; \ + done + count:: @ \ echo -n "Current hack count: " ; \ diff --git a/README b/README index 44739a66..b13f1b74 100644 --- a/README +++ b/README @@ -65,7 +65,7 @@ there's no need to recompile or reinstall anything. Along with the xscreensaver daemon itself, this package also includes numerous graphics hacks for use as screensavers. There is nothing magic about these: they are just programs that draw on the root window. -More than 175 such programs are included. For details, see the +More than 180 such programs are included. For details, see the xscreensaver web page, or the enclosed manual pages. The latest version of xscreensaver is always available on the web at @@ -76,6 +76,24 @@ the XScreenSaver FAQ about that: http://www.jwz.org/xscreensaver/faq.html ============ +Changes since 4.15: * New hacks, `polyhedra', `fuzzyflakes', `antinspect', + and `providence'. + * Minor updates to `webcollage', `bsod', `endgame', + `antspotlight', `xmatrix', and `glmatrix'. + * Added support for the RANDR (Resize and Rotate) + extension to detect when the size of the desktop has + been changed while xscreensaver is already running. + * Possibly-futile attempt to work around "rdesktop" + focus/grab idiocy. + * Made `xscreensaver-getimage -file' still work even if + imageDirectory is unset. + * Convert Latin1 to ASCII in `starwars' and `phosphor' + (since the GLUT font only has ASCII glyphs.) + * Fixed randomization in `noof'. + * Added "GetViewPortIsFullOfLies" preference to work + around longstanding XFree86 bug #421. + * Made `sonar' subnet pinging work properly on bigendian + machines (e.g., PPC.) Changes since 4.14: * New hacks, `wormhole', `mismunch', `noof', and `pacman'. * `phosphor' and `apple2' include vt100 emulators now: diff --git a/config.h.in b/config.h.in index d5688cbe..1abb2062 100644 --- a/config.h.in +++ b/config.h.in @@ -121,6 +121,12 @@ */ #undef HAVE_XINERAMA +/* Define this if you have the Resize and Rotate extension. This is standard + * on sufficiently-recent XFree86 systems, and possibly elsewhere. (It's + * available if the file /usr/include/X11/extensions/Xrandr.h exists.) + */ +#undef HAVE_RANDR + /* Define this if you have the XF86MiscSetGrabKeysState function (which allows the Ctrl-Alt-KP_star and Ctrl-Alt-KP_slash key sequences to be temporarily disabled. Sadly, it doesn't affect Ctrl-Alt-BS or Ctrl-Alt-F1.) @@ -401,6 +407,12 @@ /* Define if you have the forkpty function. */ #undef HAVE_FORKPTY +/* Define if you have the header file. */ +#undef HAVE_PTY_H + +/* Define if you have the header file. */ +#undef HAVE_UTIL_H + /* Define if you have the header file. */ #undef HAVE_UNISTD_H diff --git a/configure b/configure index 23b3ddbd..c62fcae9 100755 --- a/configure +++ b/configure @@ -856,15 +856,15 @@ Optional Packages: Installation options: --with-hackdir=DIR Where to install the hundreds of demo executables. - Default: \`PREFIX/lib/xscreensaver/' + Default: `PREFIX/lib/xscreensaver/' --with-configdir=DIR Where to install the data files that describe each of the display modes to the GUI. - Default: \`GNOMEPREFIX/control-center/screensavers/' - or \`PREFIX/lib/xscreensaver/config/', depending on + Default: `GNOMEPREFIX/control-center/screensavers/' + or `PREFIX/lib/xscreensaver/config/', depending on whether GNOME is available. Except where noted, all of the --with options below can also take a -directory argument: for example, \`--with-motif=/opt/Motif'. That would +directory argument: for example, `--with-motif=/opt/Motif'. That would cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ to be added to the -L list, assuming those directories exist. @@ -884,6 +884,7 @@ Screen blanking and idle-detection options: --with-xinerama-ext Include support for the XINERAMA extension. --with-xf86vmode-ext Include support for XFree86 virtual screens. --with-xf86gamma-ext Include support for XFree86 gamma fading. + --with-randr-ext Include support for the X Resize+Rotate extension. --with-proc-interrupts Include support for consulting the /proc/interrupts file to notice keyboard activity. --with-pam Include support for PAM (Pluggable Auth Modules.) @@ -923,8 +924,8 @@ Graphics options: --with-fortune=PROGRAM Some demos are able to run an external program and display its text; this names the program to use by default (though it can be overridden with X - resources.) Default is \"/usr/games/fortune\". - --with-setuid-hacks Allow some demos to be installed \`setuid root' + resources.) Default is "/usr/games/fortune". + --with-setuid-hacks Allow some demos to be installed `setuid root' (which is needed in order to ping other hosts.) @@ -3156,8 +3157,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether \\"\${INSTALL} -d\\" creates intermediate directories" >&5 -echo $ECHO_N "checking whether \\"\${INSTALL} -d\\" creates intermediate directories... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5 +echo $ECHO_N "checking whether \"\${INSTALL} -d\" creates intermediate directories... $ECHO_C" >&6 if test "${ac_cv_install_d_creates_dirs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10879,6 +10880,398 @@ elif test "$with_xf86gamma" != no; then fi +############################################################################### +# +# Check for the RANDR (Resize and Rotate) server extension. +# +# We need this to detect when the resolution of the desktop +# has changed out from under us (this is a newer, different +# mechanism than the XF86VMODE virtual viewports.) +# +############################################################################### + +have_randr=no +with_randr_req=unspecified + +# Check whether --with-randr-ext or --without-randr-ext was given. +if test "${with_randr_ext+set}" = set; then + withval="$with_randr_ext" + with_randr="$withval"; with_randr_req="$withval" +else + with_randr=yes +fi; + + + case "$with_randr" in + yes) ;; + no) ;; + + /*) + echo "$as_me:$LINENO: checking for RANDR headers" >&5 +echo $ECHO_N "checking for RANDR headers... $ECHO_C" >&6 + d=$with_randr/include + if test -d $d; then + X_CFLAGS="-I$d $X_CFLAGS" + echo "$as_me:$LINENO: result: $d" >&5 +echo "${ECHO_T}$d" >&6 + else + echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 +echo "${ECHO_T}not found ($d: no such directory)" >&6 + fi + + echo "$as_me:$LINENO: checking for RANDR libs" >&5 +echo $ECHO_N "checking for RANDR libs... $ECHO_C" >&6 + d=$with_randr/lib + if test -d $d; then + X_LIBS="-L$d $X_LIBS" + echo "$as_me:$LINENO: result: $d" >&5 +echo "${ECHO_T}$d" >&6 + else + echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 +echo "${ECHO_T}not found ($d: no such directory)" >&6 + fi + + # replace the directory string with "yes". + with_randr_req="yes" + with_randr=$with_randr_req + ;; + + *) + echo "" + echo "error: argument to --with-randr-ext 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_randr" = yes; then + + # first check for Randr.h + + ac_save_CPPFLAGS="$CPPFLAGS" + if test \! -z "$includedir" ; then + CPPFLAGS="$CPPFLAGS -I$includedir" + fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_extensions_Xrandr_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_extensions_Xrandr_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 +if test $ac_cv_header_X11_extensions_Xrandr_h = yes; then + have_randr=yes +fi + + + CPPFLAGS="$ac_save_CPPFLAGS" + + # if that succeeded, then check for the XRR code in the libraries + if test "$have_randr" = yes; then + + # RANDR probably needs -lXrender + xrender_libs= + + 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" + + echo "$as_me:$LINENO: checking for XRenderSetSubpixelOrder in -lXrender" >&5 +echo $ECHO_N "checking for XRenderSetSubpixelOrder in -lXrender... $ECHO_C" >&6 +if test "${ac_cv_lib_Xrender_XRenderSetSubpixelOrder+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXrender -lXext -lX11 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XRenderSetSubpixelOrder (); +int +main () +{ +XRenderSetSubpixelOrder (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xrender_XRenderSetSubpixelOrder=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xrender_XRenderSetSubpixelOrder=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&5 +echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderSetSubpixelOrder" >&6 +if test $ac_cv_lib_Xrender_XRenderSetSubpixelOrder = yes; then + xrender_libs="-lXrender" +else + true +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + + # first look for RANDR in -lXext + have_randr=no + + 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" + + echo "$as_me:$LINENO: checking for XRRGetScreenInfo in -lXext" >&5 +echo $ECHO_N "checking for XRRGetScreenInfo in -lXext... $ECHO_C" >&6 +if test "${ac_cv_lib_Xext_XRRGetScreenInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXext $xrender_libs -lXext -lX11 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XRRGetScreenInfo (); +int +main () +{ +XRRGetScreenInfo (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xext_XRRGetScreenInfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xext_XRRGetScreenInfo=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XRRGetScreenInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xext_XRRGetScreenInfo" >&6 +if test $ac_cv_lib_Xext_XRRGetScreenInfo = yes; then + have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs" +else + true +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + + # if that failed, look in -lXrandr + if test "$have_randr" = no; 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" + + echo "$as_me:$LINENO: checking for XRRGetScreenInfo in -lXrandr" >&5 +echo $ECHO_N "checking for XRRGetScreenInfo in -lXrandr... $ECHO_C" >&6 +if test "${ac_cv_lib_Xrandr_XRRGetScreenInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXrandr $xrender_libs -lXext -lX11 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XRRGetScreenInfo (); +int +main () +{ +XRRGetScreenInfo (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xrandr_XRRGetScreenInfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xrandr_XRRGetScreenInfo=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6 +if test $ac_cv_lib_Xrandr_XRRGetScreenInfo = yes; then + have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs" +else + true +fi + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" +# LIBS="$ac_save_LIBS" + + fi + fi + + # if that succeeded, then we've really got it. + if test "$have_randr" = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_RANDR 1 +_ACEOF + + fi + +elif test "$with_randr" != no; then + echo "error: must be yes or no: --with-randr-ext=$with_randr" + exit 1 +fi + + ############################################################################### # # Check for XF86MiscSetGrabKeysState (but only bother if we are already @@ -15560,7 +15953,7 @@ if test "${ac_cv_mesagl_version_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.$ac_ext < #ifndef MESA_MAJOR_VERSION @@ -17593,25 +17986,23 @@ fi ############################################################################### PTY_LIBS= -have_ptys=no - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - if test "${ac_cv_header_pty_h+set}" = set; then - echo "$as_me:$LINENO: checking for pty.h" >&5 -echo $ECHO_N "checking for pty.h... $ECHO_C" >&6 -if test "${ac_cv_header_pty_h+set}" = set; then + +for ac_header in pty.h util.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_pty_h" >&5 -echo "${ECHO_T}$ac_cv_header_pty_h" >&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking pty.h usability" >&5 -echo $ECHO_N "checking pty.h usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -17620,7 +18011,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -17646,8 +18037,8 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking pty.h presence" >&5 -echo $ECHO_N "checking pty.h presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -17655,7 +18046,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -17688,10 +18079,10 @@ echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) - { echo "$as_me:$LINENO: WARNING: pty.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pty.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pty.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pty.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## @@ -17702,12 +18093,12 @@ _ASBOX sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) - { echo "$as_me:$LINENO: WARNING: pty.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pty.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pty.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pty.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pty.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pty.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## @@ -17718,26 +18109,26 @@ _ASBOX sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for pty.h" >&5 -echo $ECHO_N "checking for pty.h... $ECHO_C" >&6 -if test "${ac_cv_header_pty_h+set}" = set; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_pty_h=$ac_header_preproc + eval "$as_ac_Header=$ac_header_preproc" fi -echo "$as_me:$LINENO: result: $ac_cv_header_pty_h" >&5 -echo "${ECHO_T}$ac_cv_header_pty_h" >&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test $ac_cv_header_pty_h = yes; then - have_ptys=yes +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi +done - CPPFLAGS="$ac_save_CPPFLAGS" -if test "$have_ptys" = yes; then - # we have the header, now check for the library - have_ptys=no ac_save_CPPFLAGS="$CPPFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -17810,9 +18201,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6 if test $ac_cv_lib_util_forkpty = yes; then - have_ptys=yes - PTY_LIBS="-lutil" - cat >>confdefs.h <<\_ACEOF + PTY_LIBS="-lutil" + cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -17822,7 +18212,6 @@ fi LDFLAGS="$ac_save_LDFLAGS" # LIBS="$ac_save_LIBS" -fi ############################################################################### @@ -20575,6 +20964,10 @@ if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then warn 'The XF86VMODE extension was requested, but was not found.' fi +if test "$with_randr_req" = yes -a "$have_randr" = no ; then + warn 'The RANDR extension was requested, but was not found.' +fi + if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then warn "Checking of /proc/interrupts was requested, but it's bogus." fi @@ -20989,7 +21382,7 @@ if test "$do_dir_warning" = yes; then echo ' "xscreensaver-demo", and "xscreensaver-command" executables' echo " will be installed in ${bindir}/." echo "" - echo " The various graphics demos (175+ different executables) will" + echo " The various graphics demos (180+ different executables) will" echo " be installed in ${HACKDIR}/." echo "" echo " If you would prefer the demos to be installed elsewhere," diff --git a/configure.in b/configure.in index e6d3cdc7..a43ce463 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# configure.in --- xscreensaver, Copyright (c) 1997-2003 Jamie Zawinski. +# configure.in --- xscreensaver, Copyright (c) 1997-2004 Jamie Zawinski. # AC_PREREQ(2.52) @@ -193,7 +193,7 @@ AC_DEFUN(AC_NO_OBJECTIVE_C, ############################################################################### AC_DEFUN(AC_PROG_INSTALL_DIRS, - [AC_CACHE_CHECK([whether \"\${INSTALL} -d\" creates intermediate directories], + [AC_CACHE_CHECK([whether "\${INSTALL} -d" creates intermediate directories], ac_cv_install_d_creates_dirs, [ac_cv_install_d_creates_dirs=no rm -rf conftestdir @@ -209,7 +209,7 @@ AC_DEFUN(AC_PROG_INSTALL_DIRS, ]) if test "$ac_cv_install_d_creates_dirs" = no ; then - AC_CACHE_CHECK([whether \"mkdir -p\" creates intermediate directories], + AC_CACHE_CHECK([whether "mkdir -p" creates intermediate directories], ac_cv_mkdir_p_creates_dirs, [ac_cv_mkdir_p_creates_dirs=no rm -rf conftestdir @@ -844,7 +844,7 @@ fi AC_PATH_XTRA if test "$have_x" != yes; then - AC_MSG_ERROR(Couldn't find X11 headers/libs. Try \`$0 --help'.) + AC_MSG_ERROR(Couldn't find X11 headers/libs. Try `$0 --help'.) fi AC_PATH_X_APP_DEFAULTS @@ -957,7 +957,7 @@ AC_ARG_WITH(hackdir,[ Installation options: --with-hackdir=DIR Where to install the hundreds of demo executables. - Default: \`PREFIX/lib/xscreensaver/'], + Default: `PREFIX/lib/xscreensaver/'], [with_hackdir="$withval"; with_hackdir_req="$withval"],[with_hackdir=yes]) if test x"$with_hackdir" = xyes; then @@ -1002,8 +1002,8 @@ with_configdir_req=unspecified AC_ARG_WITH(configdir, [ --with-configdir=DIR Where to install the data files that describe each of the display modes to the GUI. - Default: \`GNOMEPREFIX/control-center/screensavers/' - or \`PREFIX/lib/xscreensaver/config/', depending on + Default: `GNOMEPREFIX/control-center/screensavers/' + or `PREFIX/lib/xscreensaver/config/', depending on whether GNOME is available. ], [with_configdir="$withval"; with_configdir_req="$withval"], @@ -1039,7 +1039,7 @@ have_sgi=no with_sgi_req=unspecified AC_ARG_WITH(sgi-ext, [Except where noted, all of the --with options below can also take a -directory argument: for example, \`--with-motif=/opt/Motif'. That would +directory argument: for example, `--with-motif=/opt/Motif'. That would cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ to be added to the -L list, assuming those directories exist. @@ -1383,6 +1383,63 @@ elif test "$with_xf86gamma" != no; then fi +############################################################################### +# +# Check for the RANDR (Resize and Rotate) server extension. +# +# We need this to detect when the resolution of the desktop +# has changed out from under us (this is a newer, different +# mechanism than the XF86VMODE virtual viewports.) +# +############################################################################### + +have_randr=no +with_randr_req=unspecified +AC_ARG_WITH(randr-ext, +[ --with-randr-ext Include support for the X Resize+Rotate extension.], + [with_randr="$withval"; with_randr_req="$withval"],[with_randr=yes]) + +HANDLE_X_PATH_ARG(with_randr, --with-randr-ext, RANDR) + +if test "$with_randr" = yes; then + + # first check for Randr.h + AC_CHECK_X_HEADER(X11/extensions/Xrandr.h, [have_randr=yes],, + [#include ]) + + # if that succeeded, then check for the XRR code in the libraries + if test "$have_randr" = yes; then + + # RANDR probably needs -lXrender + xrender_libs= + AC_CHECK_X_LIB(Xrender, XRenderSetSubpixelOrder, + [xrender_libs="-lXrender"], [true], -lXext -lX11) + + # first look for RANDR in -lXext + have_randr=no + AC_CHECK_X_LIB(Xext, XRRGetScreenInfo, + [have_randr=yes; SAVER_LIBS="$SAVER_LIBS $xrender_libs"], + [true], $xrender_libs -lXext -lX11) + + # if that failed, look in -lXrandr + if test "$have_randr" = no; then + AC_CHECK_X_LIB(Xrandr, XRRGetScreenInfo, + [have_randr=yes; SAVER_LIBS="$SAVER_LIBS -lXrandr $xrender_libs"], + [true], $xrender_libs -lXext -lX11) + fi + fi + + # if that succeeded, then we've really got it. + if test "$have_randr" = yes; then + AC_DEFINE(HAVE_RANDR) + fi + +elif test "$with_randr" != no; then + echo "error: must be yes or no: --with-randr-ext=$with_randr" + exit 1 +fi + + ############################################################################### # # Check for XF86MiscSetGrabKeysState (but only bother if we are already @@ -3191,16 +3248,10 @@ fi ############################################################################### PTY_LIBS= -have_ptys=no -AC_CHECK_X_HEADER(pty.h, [have_ptys=yes]) -if test "$have_ptys" = yes; then - # we have the header, now check for the library - have_ptys=no - AC_CHECK_X_LIB(util, forkpty, - [have_ptys=yes - PTY_LIBS="-lutil" - AC_DEFINE(HAVE_FORKPTY)]) -fi +AC_CHECK_HEADERS(pty.h util.h) +AC_CHECK_X_LIB(util, forkpty, + [PTY_LIBS="-lutil" + AC_DEFINE(HAVE_FORKPTY)]) ############################################################################### @@ -3337,7 +3388,7 @@ AC_ARG_WITH(fortune,[ --with-fortune=PROGRAM Some demos are able to run an external program and display its text; this names the program to use by default (though it can be overridden with X - resources.) Default is \"/usr/games/fortune\".], + resources.) Default is "/usr/games/fortune".], [with_fortune_req="$withval"; with_fortune="$withval"],[with_fortune=yes]) if test "$with_fortune" = no || test "$with_fortune" = yes ; then @@ -3424,7 +3475,7 @@ AC_DEFINE_UNQUOTED(FORTUNE_PROGRAM, "$ac_cv_fortune_program") 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' +[ --with-setuid-hacks Allow some demos to be installed `setuid root' (which is needed in order to ping other hosts.) ], [setuid_hacks="$withval"], [setuid_hacks="$setuid_hacks_default"]) @@ -3813,6 +3864,10 @@ if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then warn 'The XF86VMODE extension was requested, but was not found.' fi +if test "$with_randr_req" = yes -a "$have_randr" = no ; then + warn 'The RANDR extension was requested, but was not found.' +fi + if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then warn "Checking of /proc/interrupts was requested, but it's bogus." fi @@ -4222,7 +4277,7 @@ if test "$do_dir_warning" = yes; then echo ' "xscreensaver-demo", and "xscreensaver-command" executables' echo " will be installed in ${bindir}/." echo "" - echo " The various graphics demos (175+ different executables) will" + echo " The various graphics demos (180+ different executables) will" echo " be installed in ${HACKDIR}/." echo "" echo " If you would prefer the demos to be installed elsewhere," diff --git a/driver/Makefile.in b/driver/Makefile.in index d10f3d3e..1aee1744 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -1,4 +1,4 @@ -# driver/Makefile.in --- xscreensaver, Copyright (c) 1997-1999 Jamie Zawinski. +# driver/Makefile.in --- xscreensaver, Copyright (c) 1997-2004 Jamie Zawinski. # the `../configure' script generates `driver/Makefile' from this file. @SET_MAKE@ @@ -119,10 +119,12 @@ LOCK_OBJS_1 = lock.o passwd.o NOLOCK_SRCS_1 = lock.c NOLOCK_OBJS_1 = lock.o -TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c test-grab.c \ - test-apm.c test-fade.c test-xinerama.c xdpyinfo.c -TEST_EXES = test-passwd test-uid test-xdpms test-grab \ - test-apm test-fade test-xinerama xdpyinfo +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_EXES = test-passwd test-uid test-xdpms test-grab \ + test-apm test-fade test-xinerama test-vp \ + test-randr xdpyinfo MOTIF_LIBS = @MOTIF_LIBS@ @XPM_LIBS@ $(XMU_LIBS) GTK_LIBS = @GTK_LIBS@ $(XMU_LIBS) @@ -924,6 +926,14 @@ test-xinerama: test-xinerama.o $(CC) $(LDFLAGS) -o $@ test-xinerama.o $(LIBS) $(X_LIBS) $(SAVER_LIBS)\ $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) +test-vp: test-vp.o + $(CC) $(LDFLAGS) -o $@ test-vp.o $(LIBS) $(X_LIBS) $(SAVER_LIBS) \ + $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) + +test-randr: test-randr.o + $(CC) $(LDFLAGS) -o $@ test-randr.o $(LIBS) $(X_LIBS) $(SAVER_LIBS) \ + $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) + test-grab: test-grab.o $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS) @@ -1000,7 +1010,9 @@ test-passwd.o: ../config.h test-passwd.o: $(srcdir)/prefs.h test-passwd.o: XScreenSaver_ad.h test-passwd.o: $(srcdir)/xscreensaver.h +test-randr.o: ../config.h test-uid.o: ../config.h +test-vp.o: ../config.h test-xdpms.o: ../config.h test-xinerama.o: ../config.h timers.o: ../config.h diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index fe738b08..65eccd0a 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 4.15 -! 26-Feb-2004 +! version 4.16 +! 12-May-2004 ! ! See "man xscreensaver" for more info. The latest version is always ! available at http://www.jwz.org/xscreensaver/ @@ -67,6 +67,10 @@ *xidleExtension: True *procInterrupts: True +! Set this to True if you are experiencing longstanding XFree86 bug #421 +! (xscreensaver not covering the whole screen) +GetViewPortIsFullOfLies: False + ! This is what the "Demo" button on the splash screen runs (/bin/sh syntax.) *demoCommand: xscreensaver-demo @@ -274,6 +278,7 @@ pong -root \n\ wormhole -root \n\ pacman -root \n\ + fuzzyflakes -root \n\ - default-n: webcollage -root \n\ - default-n: "WebCollage (whacked)" \ webcollage -root -filter \ @@ -317,7 +322,7 @@ @GL_KLUDGE@ GL: glsnake -root \n\ @GL_KLUDGE@ GL: boxed -root \n\ @GL_KLUDGE@ GL: "GLForestFire" glforestfire -root \n\ -- GL: "GLForestFire (rain)" glforestfire -root -rain \n\ +- GL: "GLForestFire (rain)" glforestfire -root -count 0 \n\ @GL_KLUDGE@ GL: sballs -root \n\ @GL_KLUDGE@ GL: cubenetic -root \n\ @GL_KLUDGE@ GL: spheremonics -root \n\ @@ -330,8 +335,8 @@ @GL_KLUDGE@ GL: bouncingcow -root \n\ @GL_KLUDGE@ GL: jigglypuff -root -random \n\ @GL_KLUDGE@ GL: klein -root -random \n\ -@GL_KLUDGE@ GL: "HyperTorus (striped)" hypertorus -root \n\ -@GL_KLUDGE@ GL: "HyperTorus (solid)" hypertorus -root -solid -transp \n\ +@GL_KLUDGE@ GL: "HyperTorus (striped)" hypertorus -root \n\ +@GL_KLUDGE@ GL: "HyperTorus (solid)" hypertorus -root -solid -transparent \n\ @GL_KLUDGE@ GL: glmatrix -root \n\ @GL_KLUDGE@ GL: cubestorm -root \n\ @GL_KLUDGE@ GL: glknots -root \n\ @@ -346,6 +351,7 @@ mirrorblob -root -colour -no-texture \n\ @GL_KLUDGE@ GL: blinkbox -root \n\ @GL_KLUDGE@ GL: noof -root \n\ +@GL_KLUDGE@ GL: polyhedra -root \n\ \ - xdaliclock -root -builtin3 -cycle \n\ - default-n: xearth -nofork -nostars -ncolors 50 \ @@ -364,7 +370,9 @@ - electricsheep \n\ - cosmos -root \n\ - GL: sphereEversion --root \n\ -- GL: fireflies -root \n +- GL: fireflies -root \n\ +- GL: antinspect -root \n\ +- GL: providence -root \n @@ -607,6 +615,7 @@ XScreenSaver*doc.fontList: *-helvetica-medium-r-*-*-*-100-*-*-*-iso8859-1 *hacks.fontglide.name: FontGlide *hacks.mirrorblob.name: MirrorBlob *hacks.blinkbox.name: BlinkBox +*hacks.fuzzyflakes.name: FuzzyFlakes ! obsolete, but still used by xscreensaver-demo-Xm. *hacks.documentation.isInstalled: True diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h index b3caf1df..41314222 100644 --- a/driver/XScreenSaver_ad.h +++ b/driver/XScreenSaver_ad.h @@ -36,6 +36,7 @@ "*mitSaverExtension: False", "*xidleExtension: True", "*procInterrupts: True", +"GetViewPortIsFullOfLies: False", "*demoCommand: xscreensaver-demo", "*prefsCommand: xscreensaver-demo -prefs", "*helpURL: http://www.jwz.org/xscreensaver/man.html", @@ -202,6 +203,7 @@ pong -root \\n\ wormhole -root \\n\ pacman -root \\n\ + fuzzyflakes -root \\n\ - default-n: webcollage -root \\n\ - default-n: \"WebCollage (whacked)\" \ webcollage -root -filter \ @@ -245,7 +247,7 @@ GL: glsnake -root \\n\ GL: boxed -root \\n\ GL: \"GLForestFire\" glforestfire -root \\n\ -- GL: \"GLForestFire (rain)\" glforestfire -root -rain \\n\ +- GL: \"GLForestFire (rain)\" glforestfire -root -count 0 \\n\ GL: sballs -root \\n\ GL: cubenetic -root \\n\ GL: spheremonics -root \\n\ @@ -258,8 +260,8 @@ GL: bouncingcow -root \\n\ GL: jigglypuff -root -random \\n\ GL: klein -root -random \\n\ - GL: \"HyperTorus (striped)\" hypertorus -root \\n\ - GL: \"HyperTorus (solid)\" hypertorus -root -solid -transp \\n\ + GL: \"HyperTorus (striped)\" hypertorus -root \\n\ + GL: \"HyperTorus (solid)\" hypertorus -root -solid -transparent \\n\ GL: glmatrix -root \\n\ GL: cubestorm -root \\n\ GL: glknots -root \\n\ @@ -274,6 +276,7 @@ mirrorblob -root -colour -no-texture \\n\ GL: blinkbox -root \\n\ GL: noof -root \\n\ + GL: polyhedra -root \\n\ \ - xdaliclock -root -builtin3 -cycle \\n\ - default-n: xearth -nofork -nostars -ncolors 50 \ @@ -292,7 +295,9 @@ - electricsheep \\n\ - cosmos -root \\n\ - GL: sphereEversion --root \\n\ -- GL: fireflies -root \\n", +- GL: fireflies -root \\n\ +- GL: antinspect -root \\n\ +- GL: providence -root \\n", "XScreenSaver.pointerPollTime: 0:00:05", "XScreenSaver.initialDelay: 0:00:00", "XScreenSaver.windowCreationTimeout: 0:00:30", @@ -487,4 +492,5 @@ "*hacks.fontglide.name: FontGlide", "*hacks.mirrorblob.name: MirrorBlob", "*hacks.blinkbox.name: BlinkBox", +"*hacks.fuzzyflakes.name: FuzzyFlakes", "*hacks.documentation.isInstalled: True", diff --git a/driver/demo-Gtk-conf.c b/driver/demo-Gtk-conf.c index 6416e6ce..745c6547 100644 --- a/driver/demo-Gtk-conf.c +++ b/driver/demo-Gtk-conf.c @@ -264,6 +264,8 @@ xml_get_float (xmlNodePtr node, const xmlChar *name, gboolean *floatpP) static void sanity_check_parameter (const char *filename, const xmlChar *node_name, parameter *p); +static void sanity_check_text_node (const char *filename, + const xmlNodePtr node); /* Allocates and returns a new `parameter' object based on the properties in the given XML node. Returns 0 if there's nothing @@ -293,6 +295,12 @@ make_parameter (const char *filename, xmlNodePtr node) else if (!strcmp (name, "file")) p->type = FILENAME; else if (!strcmp (name, "number")) p->type = SPINBUTTON; else if (!strcmp (name, "select")) p->type = SELECT; + else if (node->type == XML_TEXT_NODE) + { + sanity_check_text_node (filename, node); + free (p); + return 0; + } else { if (debug_p) @@ -376,6 +384,11 @@ make_select_option (const char *filename, xmlNodePtr node) { if (node->type == XML_COMMENT_NODE) return 0; + else if (node->type == XML_TEXT_NODE) + { + sanity_check_text_node (filename, node); + return 0; + } else if (node->type != XML_ELEMENT_NODE) { if (debug_p) @@ -557,6 +570,78 @@ sanity_check_parameter (const char *filename, const xmlChar *node_name, # undef WARN } +/* "text" nodes show up for all the non-tag text in the file, including + all the newlines between tags. Warn if there is text there that + is not whitespace. + */ +static void +sanity_check_text_node (const char *filename, const xmlNodePtr node) +{ + const char *body = (const char *) node->content; + if (node->type != XML_TEXT_NODE) abort(); + while (isspace (*body)) body++; + if (*body) + fprintf (stderr, "%s: WARNING: %s: random text present: \"%s\"\n", + blurb(), filename, body); +} + + +/* Returns a list of strings, every switch mentioned in the parameters. + The strings must be freed. + */ +static GList * +get_all_switches (const char *filename, GList *parms) +{ + GList *switches = 0; + GList *p; + for (p = parms; p; p = p->next) + { + parameter *pp = (parameter *) p->data; + + if (pp->type == SELECT) + { + GList *list2 = get_all_switches (filename, pp->options); + switches = g_list_concat (switches, list2); + } + if (pp->arg && *pp->arg) + switches = g_list_append (switches, strdup ((char *) pp->arg)); + if (pp->arg_set && *pp->arg_set) + switches = g_list_append (switches, strdup ((char *) pp->arg_set)); + if (pp->arg_unset && *pp->arg_unset) + switches = g_list_append (switches, strdup ((char *) pp->arg_unset)); + } + return switches; +} + + +/* Ensures that no switch is mentioned more than once. + */ +static void +sanity_check_parameters (const char *filename, GList *parms) +{ + GList *list = get_all_switches (filename, parms); + GList *p; + for (p = list; p; p = p->next) + { + char *sw = (char *) p->data; + GList *p2; + + if (*sw != '-' && *sw != '+') + fprintf (stderr, "%s: %s: switch does not begin with hyphen \"%s\"\n", + blurb(), filename, sw); + + for (p2 = p->next; p2; p2 = p2->next) + { + const char *sw2 = (const char *) p2->data; + if (!strcmp (sw, sw2)) + fprintf (stderr, "%s: %s: duplicate switch \"%s\"\n", + blurb(), filename, sw); + } + + free (sw); + } + g_list_free (list); +} /* Helper for make_parameters() @@ -618,7 +703,8 @@ make_parameters (const char *filename, xmlNodePtr node, GtkWidget *parent) { if (node->type == XML_ELEMENT_NODE && !strcmp ((char *) node->name, "screensaver")) - return make_parameters_1 (filename, node->xmlChildrenNode, parent, &row); + return make_parameters_1 (filename, node->xmlChildrenNode, + parent, &row); } return 0; } @@ -1360,7 +1446,7 @@ parse_command_line_into_parameters (const char *filename, char *option = rest->data; rest->data = 0; - if (option[0] != '-') + if (option[0] != '-' && option[0] != '+') { if (debug_p) fprintf (stderr, "%s: WARNING: %s: not a switch: \"%s\"\n", @@ -1783,6 +1869,7 @@ load_configurator_1 (const char *program, const char *arguments, gtk_widget_show (table); parms = make_parameters (file, doc->xmlRootNode, table); + sanity_check_parameters (file, parms); xmlFreeDoc (doc); diff --git a/driver/lock.c b/driver/lock.c index fd7165b6..30621cb1 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -1,5 +1,5 @@ /* lock.c --- handling the password dialog for locking-mode. - * xscreensaver, Copyright (c) 1993-2002 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2004 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 diff --git a/driver/passwd-kerberos.c b/driver/passwd-kerberos.c index 26b2cb86..398fc3c2 100644 --- a/driver/passwd-kerberos.c +++ b/driver/passwd-kerberos.c @@ -1,7 +1,6 @@ /* kpasswd.c --- verify kerberos passwords. * written by Nat Lanza (magus@cs.cmu.edu) for - * xscreensaver, Copyright (c) 1993-1997, 1998, 2000, 2003 - * Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2004 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 @@ -203,14 +202,14 @@ kerberos_passwd_valid_p (const char *typed_passwd, Bool verbose_p) sprintf(newtkfile, "/tmp/xscrn-%i.XXXXXX", getpid()); - if( (fh = mkstemp(newtktfile)) < 0) + if( (fh = mkstemp(newtkfile)) < 0) { - free(newtktfile); + free(newtkfile); return(False); } if( fchmod(fh, 0600) < 0) { - free(newtktfile); + free(newtkfile); return(False); } diff --git a/driver/passwd.c b/driver/passwd.c index c3c2b62a..d5a358c5 100644 --- a/driver/passwd.c +++ b/driver/passwd.c @@ -1,5 +1,5 @@ /* passwd.c --- verifying typed passwords with the OS. - * xscreensaver, Copyright (c) 1993-2003 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2004 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 diff --git a/driver/prefs.c b/driver/prefs.c index 6a327ac4..9a68afc7 100644 --- a/driver/prefs.c +++ b/driver/prefs.c @@ -1,5 +1,5 @@ /* dotfile.c --- management of the ~/.xscreensaver file. - * xscreensaver, Copyright (c) 1998, 2003 Jamie Zawinski + * xscreensaver, Copyright (c) 1998-2004 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 @@ -278,6 +278,7 @@ static const char * const prefs[] = { "sgiSaverExtension", "mitSaverExtension", "xidleExtension", + "GetViewPortIsFullOfLies", "procInterrupts", "overlayStderr", "overlayTextBackground", /* not saved -- X resources only */ @@ -813,6 +814,8 @@ write_init_file (saver_preferences *p, const char *version_string, CHECK("mitSaverExtension")type = pref_bool, b=p->use_mit_saver_extension; CHECK("xidleExtension") type = pref_bool, b = p->use_xidle_extension; CHECK("procInterrupts") type = pref_bool, b = p->use_proc_interrupts; + CHECK("GetViewPortIsFullOfLies") type = pref_bool, + b = p->getviewport_full_of_lies_p; CHECK("overlayStderr") type = pref_bool, b = overlay_stderr_p; CHECK("overlayTextBackground") continue; /* don't save */ CHECK("overlayTextForeground") continue; /* don't save */ @@ -1065,6 +1068,9 @@ load_init_file (saver_preferences *p) "Boolean"); p->use_proc_interrupts = get_boolean_resource ("procInterrupts", "Boolean"); + p->getviewport_full_of_lies_p = + get_boolean_resource ("GetViewPortIsFullOfLies", "Boolean"); + get_screenhacks (p); /* Parse the "programs" resource. */ p->selected_hack = get_integer_resource ("selected", "Integer"); diff --git a/driver/prefs.h b/driver/prefs.h index 0e00940b..f1db9b36 100644 --- a/driver/prefs.h +++ b/driver/prefs.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2003 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2004 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 @@ -94,6 +94,8 @@ struct saver_preferences { Bool use_sgi_saver_extension; Bool use_proc_interrupts; + Bool getviewport_full_of_lies_p; /* XFree86 bug #421 */ + char *shell; /* where to find /bin/sh */ char *demo_command; /* How to enter demo mode. */ diff --git a/driver/test-fade.c b/driver/test-fade.c index f43b87ca..9db773d0 100644 --- a/driver/test-fade.c +++ b/driver/test-fade.c @@ -1,5 +1,5 @@ /* test-fade.c --- playing with colormap and/or gamma fading. - * xscreensaver, Copyright (c) 2001 Jamie Zawinski + * xscreensaver, Copyright (c) 2001, 2004 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 @@ -106,7 +106,7 @@ main (int argc, char **argv) fprintf(stderr, "%s: out...", progname); fflush(stderr); - fade_screens (dpy, current_maps, 0, seconds, ticks, True, False); + fade_screens (dpy, current_maps, 0, 0, seconds, ticks, True, False); fprintf(stderr, "done.\n"); fflush(stderr); @@ -114,7 +114,7 @@ main (int argc, char **argv) fprintf(stderr,"%s: in...", progname); fflush(stderr); - fade_screens (dpy, current_maps, 0, seconds, ticks, False, False); + fade_screens (dpy, current_maps, 0, 0, seconds, ticks, False, False); fprintf(stderr, "done.\n"); fflush(stderr); diff --git a/driver/test-grab.c b/driver/test-grab.c index 9b4a9145..03018eb5 100644 --- a/driver/test-grab.c +++ b/driver/test-grab.c @@ -1,5 +1,5 @@ /* test-uid.c --- playing with grabs. - * xscreensaver, Copyright (c) 1999 Jamie Zawinski + * xscreensaver, Copyright (c) 1999, 2004 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 @@ -50,7 +50,7 @@ main (int argc, char **argv) kstatus = XGrabKeyboard (dpy, w, True, GrabModeSync, GrabModeAsync, CurrentTime); - fprintf (stderr, "%s: grabbing keyboard on 0x%x... %s.\n", + fprintf (stderr, "%s: grabbing keyboard on 0x%lx... %s.\n", progname, (unsigned long) w, (kstatus == GrabSuccess ? "GrabSuccess" : kstatus == AlreadyGrabbed ? "AlreadyGrabbed" : @@ -62,7 +62,7 @@ main (int argc, char **argv) mstatus = XGrabPointer (dpy, w, True, ALL_POINTER_EVENTS, GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); - fprintf (stderr, "%s: grabbing mouse on 0x%x... %s.\n", + fprintf (stderr, "%s: grabbing mouse on 0x%lx... %s.\n", progname, (unsigned long) w, (mstatus == GrabSuccess ? "GrabSuccess" : mstatus == AlreadyGrabbed ? "AlreadyGrabbed" : diff --git a/driver/test-passwd.c b/driver/test-passwd.c index 22ae01eb..d47fb4ae 100644 --- a/driver/test-passwd.c +++ b/driver/test-passwd.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1998, 2001, 2003 Jamie Zawinski +/* xscreensaver, Copyright (c) 1998-2004 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 @@ -90,6 +90,12 @@ idle_timer (XtPointer closure, XtIntervalId *id) } +#ifdef __GNUC__ + __extension__ /* shut up about "string length is greater than the length + ISO C89 compilers are required to support" when including + the .ad file... */ +#endif + static char *fallback[] = { #include "XScreenSaver_ad.h" 0 diff --git a/driver/test-randr.c b/driver/test-randr.c new file mode 100644 index 00000000..63887efa --- /dev/null +++ b/driver/test-randr.c @@ -0,0 +1,267 @@ +/* test-randr.c --- playing with the Resize And Rotate extension. + * xscreensaver, Copyright (c) 2004 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include +#include + +char *progname = 0; +char *progclass = "XScreenSaver"; + +static const char * +blurb (void) +{ + static char buf[255]; + time_t now = time ((time_t *) 0); + char *ct = (char *) ctime (&now); + int n = strlen(progname); + if (n > 100) n = 99; + strncpy(buf, progname, n); + buf[n++] = ':'; + buf[n++] = ' '; + strncpy(buf+n, ct+11, 8); + strcpy(buf+n+9, ": "); + return buf; +} + + +int +main (int argc, char **argv) +{ + int event_number, error_number; + int major, minor; + int nscreens = 0; + int i; + + XtAppContext app; + Widget toplevel_shell = XtAppInitialize (&app, progclass, 0, 0, + &argc, argv, 0, 0, 0); + Display *dpy = XtDisplay (toplevel_shell); + XtGetApplicationNameAndClass (dpy, &progname, &progclass); + + nscreens = ScreenCount(dpy); + + if (!XRRQueryExtension(dpy, &event_number, &error_number)) + { + fprintf(stderr, "%s: XRRQueryExtension(dpy, ...) ==> False\n", + blurb()); + fprintf(stderr, "%s: server does not support the RANDR extension.\n", + blurb()); + major = -1; + } + else + { + fprintf(stderr, "%s: XRRQueryExtension(dpy, ...) ==> %d, %d\n", + blurb(), event_number, error_number); + + if (!XRRQueryVersion(dpy, &major, &minor)) + { + fprintf(stderr, "%s: XRRQueryVersion(dpy, ...) ==> False\n", + blurb()); + fprintf(stderr, "%s: server didn't report RANDR version numbers?\n", + blurb()); + } + else + fprintf(stderr, "%s: XRRQueryVersion(dpy, ...) ==> %d, %d\n", blurb(), + major, minor); + } + + for (i = 0; i < nscreens; i++) + { + XRRScreenConfiguration *rrc = + (major >= 0 ? XRRGetScreenInfo (dpy, RootWindow (dpy, i)) : 0); + + if (rrc) + { + SizeID current_size = -1; + Rotation current_rotation = ~0; + + fprintf (stderr, "\n%s: Screen %d\n", blurb(), i); + + current_size = + XRRConfigCurrentConfiguration (rrc, ¤t_rotation); + + /* Times */ + { + Time server_time, config_time; + server_time = XRRConfigTimes (rrc, &config_time); + if (config_time == 0 || server_time == 0) + fprintf (stderr, "%s: config has never been changed\n", + blurb()); + else + fprintf (stderr, "%s: config changed %lu seconds ago\n", + blurb(), (unsigned long) (server_time - config_time)); + } + + /* Rotations */ + { + Rotation available, current; + available = XRRConfigRotations (rrc, ¤t); + + fprintf (stderr, "%s: Available Rotations:\t", blurb()); + if (available & RR_Rotate_0) fprintf (stderr, " 0"); + if (available & RR_Rotate_90) fprintf (stderr, " 90"); + if (available & RR_Rotate_180) fprintf (stderr, " 180"); + if (available & RR_Rotate_270) fprintf (stderr, " 270"); + if (! (available & (RR_Rotate_0 | RR_Rotate_90 | + RR_Rotate_180 | RR_Rotate_270))) + fprintf (stderr, " none"); + fprintf (stderr, "\n"); + + if (current_rotation != current) + fprintf (stderr, + "%s: WARNING: rotation inconsistency: 0x%X vs 0x%X\n", + blurb(), current_rotation, current); + + fprintf (stderr, "%s: Current Rotation:\t", blurb()); + if (current & RR_Rotate_0) fprintf (stderr, " 0"); + if (current & RR_Rotate_90) fprintf (stderr, " 90"); + if (current & RR_Rotate_180) fprintf (stderr, " 180"); + if (current & RR_Rotate_270) fprintf (stderr, " 270"); + if (! (current & (RR_Rotate_0 | RR_Rotate_90 | + RR_Rotate_180 | RR_Rotate_270))) + fprintf (stderr, " none"); + fprintf (stderr, "\n"); + + fprintf (stderr, "%s: Available Reflections:\t", blurb()); + if (available & RR_Reflect_X) fprintf (stderr, " X"); + if (available & RR_Reflect_Y) fprintf (stderr, " Y"); + if (! (available & (RR_Reflect_X | RR_Reflect_Y))) + fprintf (stderr, " none"); + fprintf (stderr, "\n"); + + fprintf (stderr, "%s: Current Reflections:\t", blurb()); + if (current & RR_Reflect_X) fprintf (stderr, " X"); + if (current & RR_Reflect_Y) fprintf (stderr, " Y"); + if (! (current & (RR_Reflect_X | RR_Reflect_Y))) + fprintf (stderr, " none"); + fprintf (stderr, "\n"); + } + + /* Sizes */ + { + int nsizes, j; + XRRScreenSize *rrsizes; + + rrsizes = XRRConfigSizes (rrc, &nsizes); + if (nsizes <= 0) + fprintf (stderr, "%s: sizes:\t none\n", blurb()); + else + for (j = 0; j < nsizes; j++) + { + short *rates; + int nrates, k; + fprintf (stderr, + "%s: %c size %d: %d x %d\t rates:", + blurb(), + (j == current_size ? '+' : ' '), + j, + rrsizes[j].width, rrsizes[j].height); + + rates = XRRConfigRates (rrc, j, &nrates); + if (nrates == 0) + fprintf (stderr, " none?"); + else + for (k = 0; k < nrates; k++) + fprintf (stderr, " %d", rates[k]); + fprintf (stderr, "\n"); + /* don't free 'rates' */ + } + /* don't free 'rrsizes' */ + } + + XRRFreeScreenConfigInfo (rrc); + } + else if (major >= 0) + { + fprintf(stderr, "%s: XRRGetScreenInfo(dpy, %d) ==> NULL\n", + blurb(), i); + } + } + + if (major > 0) + { + Window w[20]; + XWindowAttributes xgwa[20]; + + for (i = 0; i < nscreens; i++) + { + XRRSelectInput (dpy, RootWindow (dpy, i), RRScreenChangeNotifyMask); + w[i] = RootWindow (dpy, i); + XGetWindowAttributes (dpy, w[i], &xgwa[i]); + } + + XSync (dpy, False); + fprintf (stderr, "\n%s: awaiting events...\n", progname); + while (1) + { + XEvent event; + XNextEvent (dpy, &event); + + if (event.type == event_number + RRScreenChangeNotify) + { + XRRScreenChangeNotifyEvent *xrr_event = + (XRRScreenChangeNotifyEvent *) &event; + int screen = XRRRootToScreen (dpy, xrr_event->window); + + fprintf (stderr, "%s: screen %d: RRScreenChangeNotify event\n", + progname, screen); + + fprintf (stderr, "%s: screen %d: old size: \t%d x %d\n", + progname, screen, + DisplayWidth (dpy, screen), + DisplayHeight (dpy, screen)); + fprintf (stderr, "%s: screen %d: old root 0x%lx:\t%d x %d\n", + progname, screen, (unsigned long) w[screen], + xgwa[screen].width, xgwa[screen].height); + + XRRUpdateConfiguration (&event); + XSync (dpy, False); + + fprintf (stderr, "%s: screen %d: new size: \t%d x %d\n", + progname, screen, + DisplayWidth (dpy, screen), + DisplayHeight (dpy, screen)); + + w[screen] = RootWindow (dpy, screen); + XGetWindowAttributes (dpy, w[screen], &xgwa[screen]); + fprintf (stderr, "%s: screen %d: new root 0x%lx:\t%d x %d\n", + progname, screen, (unsigned long) w[screen], + xgwa[screen].width, xgwa[screen].height); + fprintf (stderr, "\n"); + } + else + { + fprintf (stderr, "%s: event %d\n", progname, event.type); + } + } + } + + XSync (dpy, False); + exit (0); +} diff --git a/driver/test-vp.c b/driver/test-vp.c new file mode 100644 index 00000000..2f11bc0d --- /dev/null +++ b/driver/test-vp.c @@ -0,0 +1,185 @@ +/* test-xinerama.c --- playing with XF86VidModeGetViewPort + * xscreensaver, Copyright (c) 2004 Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +char *progname = 0; +char *progclass = "XScreenSaver"; + +static const char * +blurb (void) +{ + static char buf[255]; + time_t now = time ((time_t *) 0); + char *ct = (char *) ctime (&now); + int n = strlen(progname); + if (n > 100) n = 99; + strncpy(buf, progname, n); + buf[n++] = ':'; + buf[n++] = ' '; + strncpy(buf+n, ct+11, 8); + strcpy(buf+n+9, ": "); + return buf; +} + + +static int +screen_count (Display *dpy) +{ + int n = ScreenCount(dpy); + int xn = 0; + int event_number, error_number; + + if (!XineramaQueryExtension (dpy, &event_number, &error_number)) + { + fprintf(stderr, "%s: XineramaQueryExtension(dpy, ...) ==> False\n", + blurb()); + goto DONE; + } + else + fprintf(stderr, "%s: XineramaQueryExtension(dpy, ...) ==> %d, %d\n", + blurb(), event_number, error_number); + + if (!XineramaIsActive(dpy)) + { + fprintf(stderr, "%s: XineramaIsActive(dpy) ==> False\n", + blurb()); + goto DONE; + } + else + { + int major, minor; + XineramaScreenInfo *xsi; + fprintf(stderr, "%s: XineramaIsActive(dpy) ==> True\n", + blurb()); + if (!XineramaQueryVersion(dpy, &major, &minor)) + { + fprintf(stderr, + "%s: XineramaQueryVersion(dpy, ...) ==> False\n", + blurb()); + goto DONE; + } + else + fprintf(stderr, + "%s: XineramaQueryVersion(dpy, ...) ==> %d, %d\n", + blurb(), major, minor); + + xsi = XineramaQueryScreens (dpy, &xn); + if (xsi) XFree (xsi); + } + + DONE: + fprintf (stderr, "\n"); + fprintf (stderr, "%s: X client screens: %d\n", blurb(), n); + fprintf (stderr, "%s: Xinerama screens: %d\n", blurb(), xn); + fprintf (stderr, "\n"); + + if (xn > n) return xn; + else return n; +} + + +int +main (int argc, char **argv) +{ + int event_number, error_number; + int major, minor; + int nscreens = 0; + int i; + + XtAppContext app; + Widget toplevel_shell = XtAppInitialize (&app, progclass, 0, 0, + &argc, argv, 0, 0, 0); + Display *dpy = XtDisplay (toplevel_shell); + XtGetApplicationNameAndClass (dpy, &progname, &progclass); + + if (!XF86VidModeQueryExtension(dpy, &event_number, &error_number)) + { + fprintf(stderr, "%s: XF86VidModeQueryExtension(dpy, ...) ==> False\n", + blurb()); + fprintf(stderr, + "%s: server does not support the XF86VidMode extension.\n", + blurb()); + exit(1); + } + else + fprintf(stderr, "%s: XF86VidModeQueryExtension(dpy, ...) ==> %d, %d\n", + blurb(), event_number, error_number); + + if (!XF86VidModeQueryVersion(dpy, &major, &minor)) + { + fprintf(stderr, "%s: XF86VidModeQueryVersion(dpy, ...) ==> False\n", + blurb()); + fprintf(stderr, + "%s: server didn't report XF86VidMode version numbers?\n", + blurb()); + } + else + fprintf(stderr, "%s: XF86VidModeQueryVersion(dpy, ...) ==> %d, %d\n", + blurb(), major, minor); + + nscreens = screen_count (dpy); + + for (i = 0; i < nscreens; i++) + { + int result; + int x = 0, y = 0, dot = 0; + XF86VidModeModeLine ml = { 0, }; + + result = XF86VidModeGetViewPort (dpy, i, &x, &y); + if (! result) + fprintf(stderr, "%s: XF86VidModeGetViewPort(dpy, %d, ...) ==> %d\n", + blurb(), i, result); + + result = XF86VidModeGetModeLine (dpy, i, &dot, &ml); + if (! result) + fprintf(stderr, "%s: XF86VidModeGetModeLine(dpy, %d, ...) ==> %d\n", + blurb(), i, result); + + fprintf (stderr, "%s: screen %d: %dx%d; viewport: %dx%d+%d+%d\n", + blurb(), i, + DisplayWidth (dpy, i), DisplayHeight (dpy, i), + ml.hdisplay, ml.vdisplay, x, y + ); + + fprintf (stderr, + "%s: hsync start %d; end %d; total %d; skew %d;\n", + blurb(), + ml.hsyncstart, ml.hsyncend, ml.htotal, ml.hskew); + fprintf (stderr, + "%s: vsync start %d; end %d; total %d; flags 0x%04x;\n", + blurb(), + ml.vsyncstart, ml.vsyncend, ml.vtotal, ml.flags); + fprintf (stderr, "\n"); + } + XSync (dpy, False); + exit (0); +} diff --git a/driver/timers.c b/driver/timers.c index d36ff701..aac16586 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -1,5 +1,5 @@ /* timers.c --- detecting when the user is idle, and other timer-related tasks. - * xscreensaver, Copyright (c) 1991-2002 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2004 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 @@ -42,6 +42,10 @@ #include #endif /* HAVE_SGI_SAVER_EXTENSION */ +#ifdef HAVE_RANDR +#include +#endif /* HAVE_RANDR */ + #include "xscreensaver.h" #ifdef HAVE_PROC_INTERRUPTS @@ -872,6 +876,42 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) else #endif /* HAVE_SGI_SAVER_EXTENSION */ +#ifdef HAVE_RANDR + if (event.type == (si->randr_event_number + RRScreenChangeNotify)) + { + /* The Resize and Rotate extension sends an event when the + size, rotation, or refresh rate of the screen has changed. */ + + XRRScreenChangeNotifyEvent *xrr_event = + (XRRScreenChangeNotifyEvent *) &event; + int screen = XRRRootToScreen (si->dpy, xrr_event->window); + + if (p->verbose_p) + { + if (si->screens[screen].width == xrr_event->width && + si->screens[screen].height == xrr_event->height) + fprintf (stderr, + "%s: %d: no-op screen size change event (%dx%d)\n", + blurb(), screen, + xrr_event->width, xrr_event->height); + else + fprintf (stderr, + "%s: %d: screen size changed from %dx%d to %dx%d\n", + blurb(), screen, + si->screens[screen].width, + si->screens[screen].height, + xrr_event->width, xrr_event->height); + } + + /* Inform Xlib that it's ok to update its data structures. */ + XRRUpdateConfiguration (&event); + + /* Resize the existing xscreensaver windows and cached ssi data. */ + resize_screensaver_window (si); + } + else +#endif /* HAVE_RANDR */ + /* Just some random event. Let the Widgets handle it, if desired. */ dispatch_event (si, &event); } diff --git a/driver/windows.c b/driver/windows.c index e06ab2e9..7ee76045 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-2003 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2004 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 @@ -47,6 +47,10 @@ # include #endif /* HAVE_XF86VMODE */ +#ifdef HAVE_XINERAMA +# include +#endif /* HAVE_XINERAMA */ + /* This file doesn't need the Xt headers, so stub these types out... */ #undef XtPointer #define XtAppContext void* @@ -166,6 +170,55 @@ ungrab_mouse(saver_info *si) } +/* Apparently there is this program called "rdesktop" which is a windows + terminal server client for Unix. It would seem that this program holds + the keyboard GRABBED the whole time it has focus! This is, of course, + completely idiotic: the whole point of grabbing is to get events when + you do *not* have focus, so grabbing *only when* you have focus is + completely redundant -- unless your goal is to make xscreensaver not + able to ever lock the screen when your program is running. + + If xscreensaver blanks while rdesktop still has a keyboard grab, then + when we try to prompt for the password, we won't get the characters: + they'll be typed into rdesktop. + + Perhaps rdesktop will release its keyboard grab if it loses focus? + What the hell, let's give it a try. If we fail to grab the keyboard + four times in a row, we forcibly set focus to "None" and try four + more times. (We don't touch focus unless we're already having a hard + time getting a grab.) + */ +static void +nuke_focus (saver_info *si, int screen_no) +{ + saver_preferences *p = &si->prefs; + Window focus = 0; + int rev = 0; + + XGetInputFocus (si->dpy, &focus, &rev); + + if (p->verbose_p) + { + char w[255], r[255]; + + if (focus == PointerRoot) strcpy (w, "PointerRoot"); + else if (focus == None) strcpy (w, "None"); + else sprintf (w, "0x%lx", (unsigned long) focus); + + if (rev == RevertToParent) strcpy (r, "RevertToParent"); + else if (rev == RevertToPointerRoot) strcpy (r, "RevertToPointerRoot"); + else if (rev == RevertToNone) strcpy (r, "RevertToNone"); + else sprintf (r, "0x%x", rev); + + fprintf (stderr, "%s: %d: removing focus from %s / %s.\n", + blurb(), screen_no, w, r); + } + + XSetInputFocus (si->dpy, None, RevertToNone, CurrentTime); + XSync (si->dpy, False); +} + + static Bool grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor, int screen_no) @@ -173,6 +226,9 @@ grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor, Status mstatus = 0, kstatus = 0; int i; int retries = 4; + Bool focus_fuckus = False; + + AGAIN: for (i = 0; i < retries; i++) { @@ -186,8 +242,17 @@ grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor, } if (kstatus != GrabSuccess) - fprintf (stderr, "%s: couldn't grab keyboard! (%s)\n", - blurb(), grab_string(kstatus)); + { + fprintf (stderr, "%s: couldn't grab keyboard! (%s)\n", + blurb(), grab_string(kstatus)); + + if (! focus_fuckus) + { + focus_fuckus = True; + nuke_focus (si, screen_no); + goto AGAIN; + } + } for (i = 0; i < retries; i++) { @@ -917,22 +982,23 @@ get_screen_viewport (saver_screen_info *ssi, int w = WidthOfScreen (ssi->screen); int h = HeightOfScreen (ssi->screen); -#ifdef HAVE_XF86VMODE +# ifdef HAVE_XF86VMODE saver_info *si = ssi->global; + saver_preferences *p = &si->prefs; int event, error; int dot; XF86VidModeModeLine ml; int x, y; Bool xinerama_p = si->xinerama_p; -#ifndef HAVE_XINERAMA +# ifndef HAVE_XINERAMA /* Even if we don't have the client-side Xinerama lib, check to see if the server supports Xinerama, so that we know to ignore the VidMode extension -- otherwise a server crash could result. Yay. */ xinerama_p = XQueryExtension (si->dpy, "XINERAMA", &error, &event, &error); -#endif /* !HAVE_XINERAMA */ +# endif /* !HAVE_XINERAMA */ -#ifdef HAVE_XINERAMA +# ifdef HAVE_XINERAMA if (xinerama_p) { int mouse_p = (target_x != -1 && target_y != -1); @@ -975,7 +1041,7 @@ get_screen_viewport (saver_screen_info *ssi, return; } -#endif /* HAVE_XINERAMA */ +# endif /* HAVE_XINERAMA */ if (!xinerama_p && /* Xinerama + VidMode = broken. */ XF86VidModeQueryExtension (si->dpy, &event, &error) && @@ -1025,6 +1091,45 @@ get_screen_viewport (saver_screen_info *ssi, *w_ret, *h_ret, *x_ret, *y_ret); + if (p->getviewport_full_of_lies_p) + { + /* XF86VidModeGetViewPort() tends to be full of lies on laptops + that have a docking station or external monitor that runs in + a different resolution than the laptop's screen: + + http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81593 + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208417 + http://bugs.xfree86.org/show_bug.cgi?id=421 + + The XFree86 developers have closed the bug. As far as I can + tell, their reason for this was, "this is an X server bug, + but it's pretty hard to fix. Therefore, we are closing it." + + So, now there's a preference item for those unfortunate users to + tell us not to trust a word that XF86VidModeGetViewPort() says. + */ + static int warned_once = 0; + if (!warned_once && verbose_p) + { + warned_once = 1; + fprintf (stderr, + "%s: %d: XF86VidModeGetViewPort() says vp is %dx%d+%d+%d;\n" + "%s: %d: assuming that is a pack of lies;\n" + "%s: %d: using %dx%d+0+0 instead.\n", + blurb(), ssi->number, + *w_ret, *h_ret, *x_ret, *y_ret, + blurb(), ssi->number, + blurb(), ssi->number, w, h); + } + + *x_ret = 0; + *y_ret = 0; + *w_ret = w; + *h_ret = h; + return; + } + + /* Apparently, though the server stores the X position in increments of 1 pixel, it will only make changes to the *display* in some other increment. With XF86_SVGA on a Thinkpad, the display only updates @@ -1052,7 +1157,7 @@ get_screen_viewport (saver_screen_info *ssi, will still look pretty stupid -- for example, "slidescreen" will cut off the left and right edges of the grid, etc. */ -# define FUDGE 16 +# define FUDGE 16 if (x > 0 && x < w - ml.hdisplay) /* not at left edge or right edge */ { /* Round X position down to next lower multiple of FUDGE. @@ -1061,7 +1166,7 @@ get_screen_viewport (saver_screen_info *ssi, *x_ret = ((x - 1) / FUDGE) * FUDGE; *w_ret += (FUDGE * 2); } -# undef FUDGE +# undef FUDGE if (*x_ret != x || *y_ret != y || @@ -1076,7 +1181,7 @@ get_screen_viewport (saver_screen_info *ssi, return; } -#endif /* HAVE_XF86VMODE */ +# endif /* HAVE_XF86VMODE */ *x_ret = 0; *y_ret = 0; @@ -1433,6 +1538,131 @@ initialize_screensaver_window (saver_info *si) } +/* Called when the RANDR (Resize and Rotate) extension tells us that the + size of the screen has changed while the screen was blanked. If we + don't do this, then the screen saver will no longer fully fill the + screen, and some of the underlying desktop may be visible. + */ +void +resize_screensaver_window (saver_info *si) +{ + saver_preferences *p = &si->prefs; + int i; + + /* First update the size info in the saver_screen_info structs. + */ + +# ifdef HAVE_XINERAMA + if (si->xinerama_p) + { + /* As of XFree86 4.3.0, the RANDR and XINERAMA extensions cannot coexist. + However, maybe they will someday, so I'm guessing that the right thing + to do in that case will be to re-query the Xinerama rectangles after + a RANDR size change is received: presumably, if the resolution of one + or more of the monitors has changed, then the Xinerama rectangle + corresponding to that monitor will also have been updated. + */ + int nscreens; + XineramaScreenInfo *xsi = XineramaQueryScreens (si->dpy, &nscreens); + if (nscreens != si->nscreens) abort(); + if (!xsi) abort(); + for (i = 0; i < si->nscreens; i++) + { + saver_screen_info *ssi = &si->screens[i]; + if (p->verbose_p && + (ssi->x != xsi[i].x_org || + ssi->y != xsi[i].y_org || + ssi->width != xsi[i].width || + ssi->height != xsi[i].height)) + fprintf (stderr, + "%s: %d: resize xinerama from %dx%d+%d+%d to %dx%d+%d+%d\n", + blurb(), i, + ssi->width, ssi->height, ssi->x, ssi->y, + xsi[i].width, xsi[i].height, xsi[i].x_org, xsi[i].y_org); + + ssi->x = xsi[i].x_org; + ssi->y = xsi[i].y_org; + ssi->width = xsi[i].width; + ssi->height = xsi[i].height; + } + XFree (xsi); + } + else +# endif /* HAVE_XINERAMA */ + { + /* Not Xinerama -- get the real sizes of the root windows. */ + for (i = 0; i < si->nscreens; i++) + { + saver_screen_info *ssi = &si->screens[i]; + XWindowAttributes xgwa; + XGetWindowAttributes (si->dpy, RootWindowOfScreen (ssi->screen), + &xgwa); + + if (p->verbose_p && + (ssi->x != xgwa.x || + ssi->y != xgwa.y || + ssi->width != xgwa.width || + ssi->height != xgwa.height)) + fprintf (stderr, + "%s: %d: resize screen from %dx%d+%d+%d to %dx%d+%d+%d\n", + blurb(), i, + ssi->width, ssi->height, ssi->x, ssi->y, + xgwa.width, xgwa.height, xgwa.x, xgwa.y); + + ssi->x = xgwa.x; + ssi->y = xgwa.y; + ssi->width = xgwa.width; + ssi->height = xgwa.height; + } + } + + /* Next, ensure that the screensaver windows are the right size, taking + into account both the new size of the screen in question's root window, + and any viewport within that. + */ + + for (i = 0; i < si->nscreens; i++) + { + saver_screen_info *ssi = &si->screens[i]; + XWindowAttributes xgwa; + XWindowChanges changes; + int x, y, width, height; + unsigned int changesmask = CWX|CWY|CWWidth|CWHeight|CWBorderWidth; + + XGetWindowAttributes (si->dpy, ssi->screensaver_window, &xgwa); + get_screen_viewport (ssi, &x, &y, &width, &height, -1, -1, + (p->verbose_p && !si->screen_blanked_p)); + if (xgwa.x == x && + xgwa.y == y && + xgwa.width == width && + xgwa.height == height) + continue; /* no change! */ + + changes.x = x; + changes.y = y; + changes.width = width; + changes.height = height; + changes.border_width = 0; + + if (p->debug_p && !p->quad_p) changes.width = changes.width / 2; + + if (p->verbose_p) + fprintf (stderr, + "%s: %d: resize 0x%lx from %dx%d+%d+%d to %dx%d+%d+%d\n", + blurb(), i, (unsigned long) ssi->screensaver_window, + xgwa.width, xgwa.height, xgwa.x, xgwa.y, + width, height, x, y); + if (! safe_XConfigureWindow (si->dpy, ssi->screensaver_window, + changesmask, &changes)) + { + fprintf (stderr, + "%s: %d: someone horked our saver window (0x%lx)! Unable to resize it!\n", + blurb(), i, (unsigned long) ssi->screensaver_window); + } + } +} + + void raise_window (saver_info *si, Bool inhibit_fade, Bool between_hacks_p, Bool dont_clear) diff --git a/driver/xscreensaver-command.man b/driver/xscreensaver-command.man index a7cea7a2..fac45a26 100644 --- a/driver/xscreensaver-command.man +++ b/driver/xscreensaver-command.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "26-Feb-2004 (4.15)" "X Version 11" +.TH XScreenSaver 1 "12-May-2004 (4.16)" "X Version 11" .SH NAME xscreensaver-command - control a running xscreensaver process .SH SYNOPSIS diff --git a/driver/xscreensaver-demo.man b/driver/xscreensaver-demo.man index 3f583321..0a9bbcab 100644 --- a/driver/xscreensaver-demo.man +++ b/driver/xscreensaver-demo.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "26-Feb-2004 (4.15)" "X Version 11" +.TH XScreenSaver 1 "12-May-2004 (4.16)" "X Version 11" .SH NAME xscreensaver-demo - interactively control the background xscreensaver daemon .SH SYNOPSIS diff --git a/driver/xscreensaver-getimage-file b/driver/xscreensaver-getimage-file index 61902049..ef0c5d55 100755 --- a/driver/xscreensaver-getimage-file +++ b/driver/xscreensaver-getimage-file @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001, 2002, 2003 Jamie Zawinski . +# Copyright © 2001, 2002, 2003, 2004 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 @@ -24,34 +24,18 @@ # Created: 12-Apr-01. require 5; -#require v5.6; use diagnostics; use strict; use POSIX; use Fcntl; -# Apparently the "old way" to get S_ISLNK and friends is to do this: -# -use POSIX ':fcntl_h'; - -# But apparently the "new way" is to do this: -# -# use Fcntl ':mode'; -# -# but of course that will generate an error on "old" (pre-5.6?) Perl versions. -# So we do it like this instead: -# -BEGIN { - if (! defined(&S_ISLNK)) { # perhaps defined by "POSIX"? - require Fcntl; - import Fcntl ':mode'; # if not, look for it in "Fcntl". - } -} +use POSIX ':fcntl_h'; # S_ISLNK was here in Perl 5.6 +import Fcntl ':mode' unless defined &S_ISLNK; # but it is here in Perl 5.8 my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.13 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.15 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; @@ -142,8 +126,8 @@ sub find_all_files { next; } - next if ($seen_inodes{$ino}); # break symlink loops - $seen_inodes{$ino} = 1; + next if ($seen_inodes{"$dev:$ino"}); # break symlink loops + $seen_inodes{"$dev:$ino"} = 1; if (S_ISDIR($mode)) { push @dirs, $file; @@ -223,9 +207,10 @@ sub find_and_display { sub usage { - print STDERR "usage: $progname [--verbose] [--name] directory\n"; - print STDERR "Puts a randomly selected image on the root window.\n"; - print STDERR "With --name, merely prints the filename to stdout.\n"; + print STDERR "usage: $progname [--verbose] [--name] file-or-directory\n\n" . + " Puts the given image file (or a randomly selected image from the\n" . + " given directory) on the root window. If --name is specified,\n" . + " just prints the selected filename to stdout instead.\n\n"; exit 1; } @@ -253,6 +238,7 @@ sub main { } elsif (-f $dir) { display_file ($dir, $displayer); } else { + print STDERR "$progname: $dir does not exist\n"; usage(); } } diff --git a/driver/xscreensaver-getimage-file.man b/driver/xscreensaver-getimage-file.man index 6dea72b9..000110bb 100644 --- a/driver/xscreensaver-getimage-file.man +++ b/driver/xscreensaver-getimage-file.man @@ -1,4 +1,4 @@ -.TH XScreenSaver 1 "26-Feb-2004 (4.15)" "X Version 11" +.TH XScreenSaver 1 "12-May-2004 (4.16)" "X Version 11" .SH NAME xscreensaver-getimage-file - put a randomly-selected image on the root window .SH SYNOPSIS diff --git a/driver/xscreensaver-getimage-video.man b/driver/xscreensaver-getimage-video.man index ed4b9f32..5d2e31f1 100644 --- a/driver/xscreensaver-getimage-video.man +++ b/driver/xscreensaver-getimage-video.man @@ -1,4 +1,4 @@ -.TH XScreenSaver 1 "26-Feb-2004 (4.15)" "X Version 11" +.TH XScreenSaver 1 "12-May-2004 (4.16)" "X Version 11" .SH NAME xscreensaver-getimage-video - put a video frame on the root window .SH SYNOPSIS diff --git a/driver/xscreensaver-getimage.c b/driver/xscreensaver-getimage.c index 67b59d06..db8bc620 100644 --- a/driver/xscreensaver-getimage.c +++ b/driver/xscreensaver-getimage.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2001, 2002, 2003 by Jamie Zawinski +/* xscreensaver, Copyright (c) 2001-2004 by Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -1479,8 +1479,7 @@ get_image (Screen *screen, video_p = False; image_p = True; } - - if (!dir || !*dir) + else if (!dir || !*dir) { if (verbose_p && image_p) fprintf (stderr, diff --git a/driver/xscreensaver-getimage.man b/driver/xscreensaver-getimage.man index 0c762221..f5e41cee 100644 --- a/driver/xscreensaver-getimage.man +++ b/driver/xscreensaver-getimage.man @@ -1,4 +1,4 @@ -.TH XScreenSaver 1 "26-Feb-2004 (4.15)" "X Version 11" +.TH XScreenSaver 1 "12-May-2004 (4.16)" "X Version 11" .SH NAME xscreensaver-getimage - put some randomly-selected image on the root window .SH SYNOPSIS diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c index 5327ccb0..5d948f65 100644 --- a/driver/xscreensaver.c +++ b/driver/xscreensaver.c @@ -1034,6 +1034,10 @@ initialize_server_extensions (saver_info *si) blurb()); } +#ifdef HAVE_RANDR + query_randr_extension (si); +#endif + if (!system_has_proc_interrupts_p) { si->using_proc_interrupts = False; @@ -2115,7 +2119,17 @@ analyze_display (saver_info *si) False # endif }, { "XINERAMA", "Xinerama", +# ifdef HAVE_XINERAMA True +# else + False +# endif + }, { "RANDR", "Resize-and-Rotate", +# ifdef HAVE_RANDR + True +# else + False +# endif }, { "Apple-DRI", "Apple-DRI (XDarwin)", True }, diff --git a/driver/xscreensaver.h b/driver/xscreensaver.h index 1ede8836..eae4d121 100644 --- a/driver/xscreensaver.h +++ b/driver/xscreensaver.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2003 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2004 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 @@ -80,6 +80,10 @@ struct saver_info { int sgi_saver_ext_event_number; int sgi_saver_ext_error_number; # endif +# ifdef HAVE_RANDR + int randr_event_number; + int randr_error_number; +# endif /* ======================================================================= @@ -299,6 +303,9 @@ extern Bool query_sgi_saver_extension (saver_info *); #ifdef HAVE_XIDLE_EXTENSION extern Bool query_xidle_extension (saver_info *); #endif +#ifdef HAVE_RANDR +extern Bool query_randr_extension (saver_info *); +#endif #ifdef HAVE_PROC_INTERRUPTS extern Bool query_proc_interrupts_available (saver_info *, const char **why); #endif @@ -318,6 +325,7 @@ extern void raise_window (saver_info *si, Bool dont_clear); extern Bool blank_screen (saver_info *si); extern void unblank_screen (saver_info *si); +extern void resize_screensaver_window (saver_info *si); extern void get_screen_viewport (saver_screen_info *ssi, int *x_ret, int *y_ret, diff --git a/driver/xscreensaver.man b/driver/xscreensaver.man index 6f9f32c8..50e403c4 100644 --- a/driver/xscreensaver.man +++ b/driver/xscreensaver.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "26-Feb-2004 (4.15)" "X Version 11" +.TH XScreenSaver 1 "12-May-2004 (4.16)" "X Version 11" .SH NAME xscreensaver - extensible screen saver framework, plus locking .SH SYNOPSIS diff --git a/driver/xset.c b/driver/xset.c index f2afcee7..d26ee1b2 100644 --- a/driver/xset.c +++ b/driver/xset.c @@ -1,5 +1,5 @@ /* xset.c --- interacting with server extensions and the builtin screensaver. - * xscreensaver, Copyright (c) 1991-2002 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2004 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 @@ -156,6 +156,39 @@ query_xidle_extension (saver_info *si) #endif /* HAVE_XIDLE_EXTENSION */ + +/* Resize and Rotate server extension hackery. + */ + +#ifdef HAVE_RANDR + +# include + +Bool +query_randr_extension (saver_info *si) +{ + saver_preferences *p = &si->prefs; + Bool ok = XRRQueryExtension (si->dpy, + &si->randr_event_number, + &si->randr_error_number); + if (ok) + { + int nscreens = ScreenCount (si->dpy); /* number of *real* screens */ + int i; + + if (p->verbose_p) + fprintf (stderr, "%s: selecting RANDR events\n", blurb()); + for (i = 0; i < nscreens; i++) + XRRSelectInput (si->dpy, RootWindow (si->dpy, i), + RRScreenChangeNotifyMask); + } + + return ok; +} + +#endif /* HAVE_XIDLE_EXTENSION */ + + /* Figuring out what the appropriate XSetScreenSaver() parameters are (one wouldn't expect this to be rocket science.) diff --git a/hacks/Makefile.in b/hacks/Makefile.in index 53520547..bf5f61d8 100644 --- a/hacks/Makefile.in +++ b/hacks/Makefile.in @@ -1,4 +1,4 @@ -# hacks/Makefile.in --- xscreensaver, Copyright (c) 1997-2002 Jamie Zawinski. +# hacks/Makefile.in --- xscreensaver, Copyright (c) 1997-2004 Jamie Zawinski. # the `../configure' script generates `hacks/Makefile' from this file. @SET_MAKE@ @@ -101,7 +101,7 @@ SRCS = attraction.c blitspin.c bouboule.c braid.c bubbles.c \ anemone.c halftone.c metaballs.c eruption.c popsquares.c \ barcode.c piecewise.c cloudlife.c fontglide.c apple2.c \ apple2-main.c analogtv.c xanalogtv.c pong.c wormhole.c \ - mismunch.c pacman.c + mismunch.c pacman.c fuzzyflakes.c SCRIPTS = vidwhacker webcollage ljlatest OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \ @@ -128,7 +128,7 @@ OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \ anemone.o halftone.o metaballs.o eruption.o popsquares.o \ barcode.o piecewise.o cloudlife.o fontglide.o apple2.o \ apple2-main.o analogtv.o xanalogtv.o pong.o wormhole.o \ - mismunch.o pacman.p + mismunch.o pacman.o fuzzyflakes.o NEXES = attraction blitspin bouboule braid bubbles decayscreen deco \ drift flag flame forest vines galaxy grav greynetic halo \ @@ -147,7 +147,7 @@ NEXES = attraction blitspin bouboule braid bubbles decayscreen deco \ juggle polyominoes thornbird fluidballs anemone halftone \ metaballs eruption popsquares barcode piecewise cloudlife \ fontglide apple2 xanalogtv pong wormhole mismunch \ - pacman \ + pacman fuzzyflakes \ @JPEG_EXES@ SEXES = sonar JPEG_EXES = webcollage-helper @@ -192,7 +192,7 @@ MEN = anemone.man ant.man apollonian.man attraction.man \ zoom.man halftone.man eruption.man metaballs.man \ barcode.man piecewise.man cloudlife.man ljlatest.man \ fontglide.man apple2.man xanalogtv.man pong.man \ - wormhole.man mismunch.man pacman.man + wormhole.man mismunch.man pacman.man fuzzyflakes.man STAR = * EXTRAS = README Makefile.in xlock_23.h xml2man.pl .gdbinit \ euler2d.tex \ @@ -782,6 +782,11 @@ wormhole: wormhole.o $(HACK_OBJS) mismunch: mismunch.o $(HACK_OBJS) $(COL) $(SPL) $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(SPL) $(HACK_LIBS) +fuzzyflakes: fuzzyflakes.o $(HACK_OBJS) + $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(HACK_LIBS) + + + # The rules for those hacks which follow the `xlockmore' API. # @@ -1087,6 +1092,8 @@ forest.o: ../config.h forest.o: $(srcdir)/screenhack.h forest.o: $(srcdir)/xlockmore.h forest.o: $(srcdir)/xlockmoreI.h +fuzzyflakes.o: ../config.h +fuzzyflakes.o: $(srcdir)/screenhack.h galaxy.o: ../config.h galaxy.o: $(srcdir)/screenhack.h galaxy.o: $(srcdir)/xlockmore.h diff --git a/hacks/analogtv.c b/hacks/analogtv.c index 85ced09c..d3d51aed 100644 --- a/hacks/analogtv.c +++ b/hacks/analogtv.c @@ -1,4 +1,4 @@ -/* analogtv, Copyright (c) 2003 Trevor Blackwell +/* analogtv, Copyright (c) 2003, 2004 Trevor Blackwell * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/hacks/analogtv.h b/hacks/analogtv.h index 2a76db0f..e63b28d7 100644 --- a/hacks/analogtv.h +++ b/hacks/analogtv.h @@ -1,4 +1,4 @@ -/* analogtv, Copyright (c) 2003 Trevor Blackwell +/* analogtv, Copyright (c) 2003, 2004 Trevor Blackwell * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/hacks/apple2-main.c b/hacks/apple2-main.c index 95078bef..1e82b42f 100644 --- a/hacks/apple2-main.c +++ b/hacks/apple2-main.c @@ -24,7 +24,12 @@ #include #ifdef HAVE_FORKPTY -# include +# ifdef HAVE_PTY_H +# include +# endif +# ifdef HAVE_UTIL_H +# include +# endif #endif /* HAVE_FORKPTY */ #undef countof diff --git a/hacks/apple2.c b/hacks/apple2.c index c2b3e652..fed55dce 100644 --- a/hacks/apple2.c +++ b/hacks/apple2.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1998-2003 Jamie Zawinski +/* xscreensaver, Copyright (c) 1998-2004 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 diff --git a/hacks/apple2.h b/hacks/apple2.h index 27202fc2..09239178 100644 --- a/hacks/apple2.h +++ b/hacks/apple2.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1998-2003 Jamie Zawinski +/* xscreensaver, Copyright (c) 1998-2004 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 diff --git a/hacks/apple2.man b/hacks/apple2.man index e29cd239..97652696 100644 --- a/hacks/apple2.man +++ b/hacks/apple2.man @@ -11,14 +11,14 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "30-Oct-99" "X Version 11" +.TH XScreenSaver 1 "5-May-2004" "X Version 11" .SH NAME apple2 - Apple ][ display emulator .SH SYNOPSIS .B apple2 [\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] -[\-visual \fIvisual\fP] [\-delay \fIseconds\fP] +[\-visual \fIvisual\fP] [\-program \fIcommand to run\fP] [\-basic] [\-slideshow] [\-text] [\-meta] [\-esc] [\-bs] [\-del] [\-fast] @@ -65,9 +65,6 @@ Install a private colormap for the window. Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. .TP 8 -.B \-delay \fIdelay\fP -The delay between displaying one crash and another. -.TP 8 .B \-basic Choose basic mode .TP 8 @@ -95,6 +92,7 @@ apple2 -text \\ apple2 -text -program 'ping apple.com' apple2 -text -program 'ps -e' apple2 -text -program 'od -txCz -w7 /dev/random' +apple2 -text -program 'cat /dev/random' apple2 -text -fast -program 'xemacs -nw -q -f life' apple2 -text -fast \\ -program 'xemacs -nw -q --eval "(hanoi 5)"' diff --git a/hacks/bsod.c b/hacks/bsod.c index 32877b8b..7019b117 100644 --- a/hacks/bsod.c +++ b/hacks/bsod.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1998-2003 Jamie Zawinski +/* xscreensaver, Copyright (c) 1998-2004 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 @@ -2940,6 +2940,72 @@ apple2crash (Display* dpy, Window window, int delay) apple2 (dpy, window, delay, a2controller_crash); } +/* MS-DOS, by jwz + */ +static void +msdos (Display *dpy, Window window, int delay) +{ + XWindowAttributes xgwa; + scrolling_window *ts; + + int delay1 = 10000; + int delay2 = 200000; + +# define CURSOR "_\b \b" +# define CURSOR2 CURSOR CURSOR CURSOR + + XGetWindowAttributes (dpy, window, &xgwa); + ts = make_scrolling_window (dpy, window, "MSDOS", False); + + XClearWindow(dpy, window); + + scrolling_puts (ts, "C:\\WINDOWS>", delay1); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, CURSOR2 "dir a:", delay2); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, "\nNot ready reading drive A\nAbort, Retry, Fail?", + delay1); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, CURSOR2 "f", delay2); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, "\n\n\nNot ready reading drive A\nAbort, Retry, Fail?", + delay1); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, CURSOR2 "f", delay2); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, "\nVolume in drive A has no label\n\n" + "Not ready reading drive A\nAbort, Retry, Fail?", + delay1); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, CURSOR2 "a", delay2); + if (bsod_sleep(dpy, 1)) goto DONE; + + scrolling_puts (ts, "\n\nC:\\WINDOWS>", delay1); + + { + time_t start = time((time_t *) 0); + while (start + delay > time((time_t *) 0)) + if (scrolling_puts (ts, CURSOR, delay2)) + break; + } + + DONE: + XClearWindow(dpy, window); + +# undef CURSOR +# undef CURSOR2 +} + + + + char *progclass = "BSOD"; char *defaults [] = { @@ -2966,6 +3032,7 @@ char *defaults [] = { "*doOS390: True", "*doVMS: True", "*doHVX: True", + "*doMSDOS: True", ".Windows.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*", ".Windows.font2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*", @@ -3055,6 +3122,11 @@ char *defaults [] = { ".VMS.foreground: White", ".VMS.background: Black", + ".MSDOS.font: 9x15bold", + ".MSDOS.font2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*", + ".MSDOS.foreground: White", + ".MSDOS.background: Black", + ANALOGTV_DEFAULTS #ifdef HAVE_XSHM_EXTENSION @@ -3106,6 +3178,8 @@ XrmOptionDescRec options [] = { { "-no-os390", ".doOS390", XrmoptionNoArg, "False" }, { "-vms", ".doVMS", XrmoptionNoArg, "True" }, { "-no-vms", ".doVMS", XrmoptionNoArg, "False" }, + { "-msdos", ".doMSDOS", XrmoptionNoArg, "True" }, + { "-no-msdos", ".doMSDOS", XrmoptionNoArg, "False" }, ANALOGTV_OPTIONS { 0, 0, 0, 0 } }; @@ -3135,6 +3209,7 @@ static struct { { "OS390", os390 }, { "Apple2", apple2crash }, { "VMS", vms }, + { "MSDOS", msdos }, }; diff --git a/hacks/bsod.man b/hacks/bsod.man index b581d91b..26572de7 100644 --- a/hacks/bsod.man +++ b/hacks/bsod.man @@ -11,7 +11,7 @@ .if n .sp 1 .if t .sp .5 .. -.TH XScreenSaver 1 "28-Oct-98" "X Version 11" +.TH XScreenSaver 1 "5-May-2004" "X Version 11" .SH NAME bsod - Blue Screen of Death emulator .SH SYNOPSIS @@ -26,10 +26,11 @@ program is the finest in personal computer emulation. .PP .I bsod steps through a set of screens, each one a recreation of a different failure -mode of an operating system. Systems depicted include Microsoft's Windows 95 -and Windows NT, Commodore-Amiga's AmigaDOS 1.3, SPARC Linux, SCO UNIX, -HPUX, IBM OS/360, the Apple Macintosh (both the MacsBug debugger and the -rarer "Sad Mac"), the Atari ST, and the Apple ][+. +mode of an operating system. Systems depicted include +Windows 3.1, Windows 95, Windows NT, MS-DOS, AmigaDOS 1.3, Linux, +SCO UNIX, BSD UNIX, HPUX, Solaris, VMS, HVX/GCOS6, IBM OS/390, +MacOS (MacsBug, Bomb, Sad Mac, and OSX), Atari ST, Apple ][+, and +NCD X Terminals. .PP .SH OPTIONS .I bsod @@ -87,6 +88,7 @@ hacks are displayed and which aren't. .BR doApple2 , .BR doOS390 , .BR doVMS , +.BR doMSDOS , and .BR doHVX . Each of these is a Boolean resource, they all default to true, except diff --git a/hacks/compile_axp.com b/hacks/compile_axp.com index 8beb3cb7..24eecb2d 100644 --- a/hacks/compile_axp.com +++ b/hacks/compile_axp.com @@ -38,6 +38,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLUIDBALLS.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FONTGLIDE.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FOREST.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FUZZYFLAKES.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GALAXY.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GOOP.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GRAV.C diff --git a/hacks/compile_decc.com b/hacks/compile_decc.com index 8beb3cb7..24eecb2d 100644 --- a/hacks/compile_decc.com +++ b/hacks/compile_decc.com @@ -38,6 +38,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLUIDBALLS.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FONTGLIDE.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FOREST.C +$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FUZZYFLAKES.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GALAXY.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GOOP.C $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) GRAV.C diff --git a/hacks/config/README b/hacks/config/README index d43165d1..7976bc42 100644 --- a/hacks/config/README +++ b/hacks/config/README @@ -4,8 +4,8 @@ a screen saver and locker for the X window system by Jamie Zawinski - version 4.15 - 26-Feb-2004 + version 4.16 + 12-May-2004 http://www.jwz.org/xscreensaver/ diff --git a/hacks/config/anemone.xml b/hacks/config/anemone.xml index 6f056102..93cc85f9 100644 --- a/hacks/config/anemone.xml +++ b/hacks/config/anemone.xml @@ -9,7 +9,7 @@ -turnspeed 50 --> - diff --git a/hacks/config/ant.xml b/hacks/config/ant.xml index 2266d858..36499dfc 100644 --- a/hacks/config/ant.xml +++ b/hacks/config/ant.xml @@ -10,7 +10,7 @@ - diff --git a/hacks/config/antinspect.xml b/hacks/config/antinspect.xml new file mode 100644 index 00000000..0d0767f5 --- /dev/null +++ b/hacks/config/antinspect.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + <_description> +Draws a trio of ants moving their spheres around a circle. +Written by Blair Tennessy. + + diff --git a/hacks/config/antspotlight.xml b/hacks/config/antspotlight.xml index 1301826e..f01b9fc0 100644 --- a/hacks/config/antspotlight.xml +++ b/hacks/config/antspotlight.xml @@ -4,7 +4,7 @@ - diff --git a/hacks/config/apollonian.xml b/hacks/config/apollonian.xml index 0f89877d..a3e8f33c 100644 --- a/hacks/config/apollonian.xml +++ b/hacks/config/apollonian.xml @@ -19,7 +19,7 @@ _label="Number of Colors" _low-label="Two" _high-label="Many" low="2" high="255" default="64"/> - diff --git a/hacks/config/attraction.xml b/hacks/config/attraction.xml index cc815f05..b04aa6a3 100644 --- a/hacks/config/attraction.xml +++ b/hacks/config/attraction.xml @@ -42,7 +42,7 @@ _label="Trail Length" _low-label="Short" _high-label="Long" low="2" high="1000" default="500"/> - diff --git a/hacks/config/atunnel.xml b/hacks/config/atunnel.xml index 55f31f01..60637f0e 100644 --- a/hacks/config/atunnel.xml +++ b/hacks/config/atunnel.xml @@ -4,7 +4,7 @@ - diff --git a/hacks/config/barcode.xml b/hacks/config/barcode.xml index f568131e..b65a8a86 100644 --- a/hacks/config/barcode.xml +++ b/hacks/config/barcode.xml @@ -10,7 +10,7 @@