it's works
authortanya <tanyshk@gmail.com>
Mon, 9 Aug 2010 12:30:43 +0000 (15:30 +0300)
committertanya <tanyshk@gmail.com>
Mon, 9 Aug 2010 12:30:43 +0000 (15:30 +0300)
40 files changed:
xscreensaver/config.guess
xscreensaver/config.h.in
xscreensaver/config.sub
xscreensaver/configure
xscreensaver/configure.in
xscreensaver/driver/Makefile.in
xscreensaver/driver/XScreenSaver.ad.in
xscreensaver/driver/XScreenSaver_Xm_ad.h [deleted file]
xscreensaver/driver/XScreenSaver_ad.h
xscreensaver/driver/demo-Gtk.c
xscreensaver/driver/exec.c
xscreensaver/driver/lock.c
xscreensaver/driver/mlstring.c
xscreensaver/driver/passwd-kerberos.c
xscreensaver/driver/passwd-pam.c
xscreensaver/driver/pdf2jpeg.m
xscreensaver/driver/prefs.c
xscreensaver/driver/screensaver-properties.desktop.in
xscreensaver/driver/splash.c
xscreensaver/driver/stderr.c
xscreensaver/driver/subprocs.c
xscreensaver/driver/test-passwd.c
xscreensaver/driver/test-randr.c
xscreensaver/driver/timers.c
xscreensaver/driver/types.h
xscreensaver/driver/windows.c
xscreensaver/driver/xscreensaver-command.c
xscreensaver/driver/xscreensaver-getimage-file
xscreensaver/driver/xscreensaver-getimage-video
xscreensaver/driver/xscreensaver-text
xscreensaver/driver/xscreensaver.c
xscreensaver/driver/xscreensaver.h
xscreensaver/hacks/Makefile.in
xscreensaver/hacks/barcode.c
xscreensaver/hacks/glx/glsnake.c
xscreensaver/hacks/lcdscrub [changed mode: 0644->0755]
xscreensaver/hacks/screenhack.c
xscreensaver/hacks/vidwhacker
xscreensaver/hacks/webcollage
xscreensaver/hacks/xanalogtv.c

index 951383e..45bee13 100644 (file)
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-#   Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2007-05-17'
+timestamp='2005-04-22'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -18,15 +17,13 @@ timestamp='2007-05-17'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-
 # Originally written by Per Bothner <per@bothner.com>.
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -69,11 +66,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit 0 ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit 0 ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit 0 ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -107,7 +104,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -126,7 +123,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+esac ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -161,7 +158,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
-           sh5el) machine=sh5le-unknown ;;
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
@@ -200,23 +196,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
-       exit ;;
+       exit 0 ;;
+    amd64:OpenBSD:*:*)
+       echo x86_64-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    amiga:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    cats:OpenBSD:*:*)
+       echo arm-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    hp300:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    luna88k:OpenBSD:*:*)
+       echo m88k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    macppc:OpenBSD:*:*)
+       echo powerpc-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+       echo m88k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+       echo powerpc-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sgi:OpenBSD:*:*)
+       echo mips64-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
     *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit ;;
-    *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     macppc:MirBSD:*:*)
-       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+       exit 0 ;;
     *:MirBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -269,43 +297,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
+       exit 0 ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
        # of the specific Alpha model?
        echo alpha-pc-interix
-       exit ;;
+       exit 0 ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
-       exit ;;
+       exit 0 ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
-       exit ;;
+       exit 0;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
+       exit 0 ;;
     *:[Mm]orph[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
+       exit 0 ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
-       exit ;;
+       exit 0 ;;
     *:z/VM:*:*)
        echo s390-ibm-zvmoe
-       exit ;;
+       exit 0 ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-       exit ;;
+       exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
-       exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-       echo arm-unknown-riscos
-       exit ;;
+       exit 0;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
-       exit ;;
+       exit 0;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -313,32 +338,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        else
                echo pyramid-pyramid-bsd
        fi
-       exit ;;
+       exit 0 ;;
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
-       exit ;;
+       exit 0 ;;
     DRS?6000:unix:4.0:6*)
        echo sparc-icl-nx6
-       exit ;;
+       exit 0 ;;
     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
        case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7; exit ;;
+           sparc) echo sparc-icl-nx7 && exit 0 ;;
        esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit 0 ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
-    i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
+       exit 0 ;;
+    i86pc:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit 0 ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit 0 ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
            Series*|S4*)
@@ -347,10 +372,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
+       exit 0 ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -362,10 +387,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                echo sparc-sun-sunos${UNAME_RELEASE}
                ;;
        esac
-       exit ;;
+       exit 0 ;;
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -376,40 +401,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
-       exit ;;
+       exit 0 ;;
     RISC*:ULTRIX:*:*)
        echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -433,33 +458,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
-           { echo "$SYSTEM_NAME"; exit; }
+       $CC_FOR_BUILD -o $dummy $dummy.c \
+         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && exit 0
        echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
-       exit ;;
+       exit 0 ;;
     Motorola:*:4.3:PL8-*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit 0 ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
-       exit ;;
+       exit 0 ;;
     m88k:CX/UX:7*:*)
        echo m88k-harris-cxux7
-       exit ;;
+       exit 0 ;;
     m88k:*:4*:R4*)
        echo m88k-motorola-sysv4
-       exit ;;
+       exit 0 ;;
     m88k:*:3*:R3*)
        echo m88k-motorola-sysv3
-       exit ;;
+       exit 0 ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -475,29 +499,29 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit 0 ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
-       exit ;;
+       exit 0 ;;
     M88*:*:R3*:*)
        # Delta 88k system running SVR3
        echo m88k-motorola-sysv3
-       exit ;;
+       exit 0 ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
        echo m88k-tektronix-sysv3
-       exit ;;
+       exit 0 ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
        echo m68k-tektronix-bsd
-       exit ;;
+       exit 0 ;;
     *:IRIX*:*:*)
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
+       exit 0 ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
-       exit ;;
+       exit 0 ;;
     ia64:AIX:*:*)
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
@@ -505,7 +529,7 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
+       exit 0 ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
                eval $set_cc_for_build
@@ -520,18 +544,14 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-               then
-                       echo "$SYSTEM_NAME"
-               else
-                       echo rs6000-ibm-aix3.2.5
-               fi
+               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+               echo rs6000-ibm-aix3.2.5
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
        else
                echo rs6000-ibm-aix3.2
        fi
-       exit ;;
+       exit 0 ;;
     *:AIX:*:[45])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -545,28 +565,28 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
+       exit 0 ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
-       exit ;;
+       exit 0 ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
-       exit ;;
+       exit 0 ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit ;;                             # report: romp-ibm BSD 4.3
+       exit 0 ;;                           # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
-       exit ;;
+       exit 0 ;;
     DPX/2?00:B.O.S.:*:*)
        echo m68k-bull-sysv3
-       exit ;;
+       exit 0 ;;
     9000/[34]??:4.3bsd:1.*:*)
        echo m68k-hp-bsd
-       exit ;;
+       exit 0 ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
        echo m68k-hp-bsd4.4
-       exit ;;
+       exit 0 ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        case "${UNAME_MACHINE}" in
@@ -628,19 +648,9 @@ EOF
        esac
        if [ ${HP_ARCH} = "hppa2.0w" ]
        then
-           eval $set_cc_for_build
-
-           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-           # generating 64-bit code.  GNU and HP use different nomenclature:
-           #
-           # $ CC_FOR_BUILD=cc ./config.guess
-           # => hppa2.0w-hp-hpux11.23
-           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-           # => hppa64-hp-hpux11.23
-
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-               grep __LP64__ >/dev/null
+           # avoid double evaluation of $set_cc_for_build
+           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
            then
                HP_ARCH="hppa2.0w"
            else
@@ -648,11 +658,11 @@ EOF
            fi
        fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
+       exit 0 ;;
     ia64:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
+       exit 0 ;;
     3050*:HI-UX:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -680,182 +690,161 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-               { echo "$SYSTEM_NAME"; exit; }
+       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
        echo unknown-hitachi-hiuxwe2
-       exit ;;
+       exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
        echo hppa1.1-hp-bsd
-       exit ;;
+       exit 0 ;;
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
-       exit ;;
+       exit 0 ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
-       exit ;;
+       exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
-       exit ;;
+       exit 0 ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
-       exit ;;
+       exit 0 ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
            echo ${UNAME_MACHINE}-unknown-osf1mk
        else
            echo ${UNAME_MACHINE}-unknown-osf1
        fi
-       exit ;;
+       exit 0 ;;
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
-       exit ;;
+       exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+        exit 0 ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+        exit 0 ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+        exit 0 ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+        exit 0 ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+        exit 0 ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit 0 ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit 0 ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit 0 ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit 0 ;;
     *:UNICOS/mp:*:*)
        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit 0 ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+        exit 0 ;;
     5000:UNIX_System_V:4.*:*)
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-       exit ;;
+       exit 0 ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:FreeBSD:*:*)
-       case ${UNAME_MACHINE} in
-           pc98)
-               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-           amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-       esac
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit 0 ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
-    *:MINGW*:*)
+       exit 0 ;;
+    i*:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
-       exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
-       exit ;;
+       exit 0 ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
-       exit ;;
-    *:Interix*:[3456]*)
-       case ${UNAME_MACHINE} in
-           x86) 
-               echo i586-pc-interix${UNAME_RELEASE}
-               exit ;;
-           EM64T | authenticamd)
-               echo x86_64-unknown-interix${UNAME_RELEASE}
-               exit ;;
-       esac ;;
+       exit 0 ;;
+    x86:Interix*:[34]*)
+       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+       exit 0 ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
+       exit 0 ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
        # UNAME_MACHINE based on the output of uname instead of i386?
        echo i586-pc-interix
-       exit ;;
+       exit 0 ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
-       exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       exit 0 ;;
+    amd64:CYGWIN*:*:*)
        echo x86_64-unknown-cygwin
-       exit ;;
+       exit 0 ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
-       exit ;;
+       exit 0 ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit 0 ;;
     *:GNU:*:*)
        # the GNU system
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit ;;
+       exit 0 ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-       exit ;;
+       exit 0 ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
+       exit 0 ;;
     arm*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     cris:Linux:*:*)
        echo cris-axis-linux-gnu
-       exit ;;
+       exit 0 ;;
     crisv32:Linux:*:*)
        echo crisv32-axis-linux-gnu
-       exit ;;
+       exit 0 ;;
     frv:Linux:*:*)
        echo frv-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     ia64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     m32r*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     mips:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -872,12 +861,8 @@ EOF
        #endif
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
        ;;
     mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -895,22 +880,15 @@ EOF
        #endif
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
        ;;
-    or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
-       exit ;;
     ppc:Linux:*:*)
        echo powerpc-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     ppc64:Linux:*:*)
        echo powerpc64-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -924,7 +902,7 @@ EOF
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit ;;
+       exit 0 ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -932,31 +910,25 @@ EOF
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
          *)    echo hppa-unknown-linux-gnu ;;
        esac
-       exit ;;
+       exit 0 ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
        echo hppa64-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
+       exit 0 ;;
     sh64*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-    vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-gnu
-       exit ;;
+       exit 0 ;;
     x86_64:Linux:*:*)
        echo x86_64-unknown-linux-gnu
-       exit ;;
-    xtensa:Linux:*:*)
-       echo xtensa-unknown-linux-gnu
-       exit ;;
+       exit 0 ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
@@ -974,15 +946,15 @@ EOF
                ;;
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
+               exit 0 ;;
          coff-i386)
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
+               exit 0 ;;
          "")
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
                # one that does not give us useful --help.
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
+               exit 0 ;;
        esac
        # Determine whether the default compiler is a.out or elf
        eval $set_cc_for_build
@@ -999,7 +971,7 @@ EOF
        LIBC=gnulibc1
        # endif
        #else
-       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       #ifdef __INTEL_COMPILER
        LIBC=gnu
        #else
        LIBC=gnuaout
@@ -1009,23 +981,16 @@ EOF
        LIBC=dietlibc
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^LIBC/{
-               s: ::g
-               p
-           }'`"
-       test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-               exit
-       }
-       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
        ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
        # sysname and nodename.
        echo i386-sequent-sysv4
-       exit ;;
+       exit 0 ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -1033,27 +998,27 @@ EOF
        # I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
+       exit 0 ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
        echo ${UNAME_MACHINE}-pc-os2-emx
-       exit ;;
+       exit 0 ;;
     i*86:XTS-300:*:STOP)
        echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
+       exit 0 ;;
     i*86:atheos:*:*)
        echo ${UNAME_MACHINE}-unknown-atheos
-       exit ;;
-    i*86:syllable:*:*)
+       exit 0 ;;
+       i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
-       exit ;;
+       exit 0 ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     i*86:*DOS:*:*)
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
+       exit 0 ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1061,16 +1026,15 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
-       exit ;;
-    i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       exit 0 ;;
+    i*86:*:5:[78]*)
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit ;;
+       exit 0 ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1088,73 +1052,73 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
-       exit ;;
+       exit 0 ;;
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
        echo i386-pc-msdosdjgpp
-        exit ;;
+        exit 0 ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
-       exit ;;
+       exit 0 ;;
     paragon:*:*:*)
        echo i860-intel-osf1
-       exit ;;
+       exit 0 ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
-       exit ;;
+       exit 0 ;;
     mini*:CTIX:SYS*5:*)
        # "miniframe"
        echo m68010-convergent-sysv
-       exit ;;
+       exit 0 ;;
     mc68k:UNIX:SYSTEM5:3.51m)
        echo m68k-convergent-sysv
-       exit ;;
+       exit 0 ;;
     M680?0:D-NIX:5.3:*)
        echo m68k-diab-dnix
-       exit ;;
+       exit 0 ;;
     M68*:*:R3V[5678]*:*)
-       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+          && echo i486-ncr-sysv4 && exit 0 ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
-       exit ;;
+       exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit 0 ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit 0 ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1162,81 +1126,73 @@ EOF
        else
                echo ns32k-sni-sysv
        fi
-       exit ;;
+       exit 0 ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit ;;
+        exit 0 ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
        echo hppa1.1-stratus-sysv4
-       exit ;;
+       exit 0 ;;
     *:*:*:FTX*)
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
-       exit ;;
+       exit 0 ;;
     i*86:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo ${UNAME_MACHINE}-stratus-vos
-       exit ;;
+       exit 0 ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
-       exit ;;
+       exit 0 ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
-       exit ;;
+       exit 0 ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
                echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+        exit 0 ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
-       exit ;;
+       exit 0 ;;
     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
        echo powerpc-apple-beos
-       exit ;;
+       exit 0 ;;
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
-       exit ;;
+       exit 0 ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-7:SUPER-UX:*:*)
-       echo sx7-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-8:SUPER-UX:*:*)
-       echo sx8-nec-superux${UNAME_RELEASE}
-       exit ;;
-    SX-8R:SUPER-UX:*:*)
-       echo sx8r-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:Rhapsody:*:*)
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
        case $UNAME_PROCESSOR in
+           *86) UNAME_PROCESSOR=i686 ;;
            unknown) UNAME_PROCESSOR=powerpc ;;
        esac
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
        if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1244,25 +1200,25 @@ EOF
                UNAME_MACHINE=pc
        fi
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
-       exit ;;
+       exit 0 ;;
     NSE-?:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
-       exit ;;
+       exit 0 ;;
     BS2000:POSIX*:*:*)
        echo bs2000-siemens-sysv
-       exit ;;
+       exit 0 ;;
     DS/*:UNIX_System_V:*:*)
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
@@ -1273,47 +1229,41 @@ EOF
            UNAME_MACHINE="$cputype"
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
+       exit 0 ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
-       exit ;;
+       exit 0 ;;
     *:TENEX:*:*)
        echo pdp10-unknown-tenex
-       exit ;;
+       exit 0 ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
-       exit ;;
+       exit 0 ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
        echo pdp10-xkl-tops20
-       exit ;;
+       exit 0 ;;
     *:TOPS-20:*:*)
        echo pdp10-unknown-tops20
-       exit ;;
+       exit 0 ;;
     *:ITS:*:*)
        echo pdp10-unknown-its
-       exit ;;
+       exit 0 ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-       exit ;;
+       exit 0 ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
+       exit 0 ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
-           A*) echo alpha-dec-vms ; exit ;;
-           I*) echo ia64-dec-vms ; exit ;;
-           V*) echo vax-dec-vms ; exit ;;
+           A*) echo alpha-dec-vms && exit 0 ;;
+           I*) echo ia64-dec-vms && exit 0 ;;
+           V*) echo vax-dec-vms && exit 0 ;;
        esac ;;
     *:XENIX:*:SysV)
        echo i386-pc-xenix
-       exit ;;
-    i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-       exit ;;
-    i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
-       exit ;;
+       exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1345,7 +1295,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
+  printf ("arm-acorn-riscix"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1434,12 +1384,11 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-       { echo "$SYSTEM_NAME"; exit; }
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1448,22 +1397,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
        echo c1-convex-bsd
-       exit ;;
+       exit 0 ;;
     c2*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-       exit ;;
+       exit 0 ;;
     c34*)
        echo c34-convex-bsd
-       exit ;;
+       exit 0 ;;
     c38*)
        echo c38-convex-bsd
-       exit ;;
+       exit 0 ;;
     c4*)
        echo c4-convex-bsd
-       exit ;;
+       exit 0 ;;
     esac
 fi
 
index c568391..21b68cd 100644 (file)
    available if the file /usr/include/X11/extensions/Xrandr.h exists.) */
 #undef HAVE_RANDR
 
+/* Define this if the RANDR library is version 1.2 or newer. */
+#undef HAVE_RANDR_12
+
 /* Define this if you have the XReadDisplay extension (I think this is an
    SGI-only thing; it's in <X11/extensions/readdisplay.h>.) A few of the
    screenhacks will take advantage of this if it's available. */
index c060f44..87a1ee4 100644 (file)
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-#   Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2007-04-29'
+timestamp='2005-04-22'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -22,15 +21,14 @@ timestamp='2007-04-29'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -85,11 +83,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit 0 ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit 0 ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit 0 ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -101,7 +99,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit ;;
+       exit 0;;
 
     * )
        break ;;
@@ -120,9 +118,8 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -173,10 +170,6 @@ case $os in
        -hiux*)
                os=-hiuxwe2
                ;;
-       -sco6)
-               os=-sco5v6
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
        -sco5)
                os=-sco3.2v5
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -193,10 +186,6 @@ case $os in
                # Don't forget version if it is 3.2v4 or newer.
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
-       -sco5v6*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
        -sco*)
                os=-sco3.2v2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -241,16 +230,15 @@ case $basic_machine in
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
-       | fido | fr30 | frv \
+       | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep \
+       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -259,7 +247,6 @@ case $basic_machine in
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
        | mipsisa32 | mipsisa32el \
        | mipsisa32r2 | mipsisa32r2el \
        | mipsisa64 | mipsisa64el \
@@ -268,24 +255,21 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
-       | mt \
        | msp430 \
-       | nios | nios2 \
        | ns16k | ns32k \
-       | or32 \
+       | openrisc | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
-       | score \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu | strongarm \
+       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b \
+       | strongarm \
        | tahoe | thumb | tic4x | tic80 | tron \
        | v850 | v850e \
        | we32k \
-       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
        | z8k)
                basic_machine=$basic_machine-unknown
                ;;
@@ -296,9 +280,6 @@ case $basic_machine in
                ;;
        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
-       ms1)
-               basic_machine=mt-unknown
-               ;;
 
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
@@ -318,18 +299,18 @@ case $basic_machine in
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* | avr32-* \
+       | avr-* \
        | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
-       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
-       | m32c-* | m32r-* | m32rle-* \
+       | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
        | m88110-* | m88k-* | maxq-* | mcore-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -340,7 +321,6 @@ case $basic_machine in
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
        | mipsisa32-* | mipsisa32el-* \
        | mipsisa32r2-* | mipsisa32r2el-* \
        | mipsisa64-* | mipsisa64el-* \
@@ -349,26 +329,24 @@ case $basic_machine in
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
        | mipstx39-* | mipstx39el-* \
        | mmix-* \
-       | mt-* \
        | msp430-* \
-       | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
        | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa-* \
        | ymp-* \
        | z8k-*)
@@ -683,10 +661,6 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-mingw32
                ;;
-       mingw32ce)
-               basic_machine=arm-unknown
-               os=-mingw32ce
-               ;;
        miniframe)
                basic_machine=m68000-convergent
                ;;
@@ -712,9 +686,6 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-msdos
                ;;
-       ms1-*)
-               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
@@ -790,8 +761,9 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
-       openrisc | openrisc-*)
+       or32 | or32-*)
                basic_machine=or32-unknown
+               os=-coff
                ;;
        os400)
                basic_machine=powerpc-ibm
@@ -822,12 +794,6 @@ case $basic_machine in
        pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pc98)
-               basic_machine=i386-pc
-               ;;
-       pc98-*)
-               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
        pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
@@ -884,10 +850,6 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
-       rdos)
-               basic_machine=i386-pc
-               os=-rdos
-               ;;
        rom68k)
                basic_machine=m68k-rom68k
                os=-coff
@@ -914,10 +876,6 @@ case $basic_machine in
        sb1el)
                basic_machine=mipsisa64sb1el-unknown
                ;;
-       sde)
-               basic_machine=mipsisa32-sde
-               os=-elf
-               ;;
        sei)
                basic_machine=mips-sei
                os=-seiux
@@ -929,9 +887,6 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
-       sh5el)
-               basic_machine=sh5le-unknown
-               ;;
        sh64)
                basic_machine=sh64-unknown
                ;;
@@ -1134,10 +1089,13 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b)
                basic_machine=sparc-sun
                ;;
        cydra)
@@ -1210,23 +1168,20 @@ case $os in
              | -aos* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -openbsd* | -solidbsd* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
-             | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1244,7 +1199,7 @@ case $os in
                os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
                ;;
        -mac*)
@@ -1378,12 +1333,6 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
-               os=-elf
-               ;;
-        spu-*)
-               os=-elf
-               ;;
        *-acorn)
                os=-riscix1.2
                ;;
@@ -1393,9 +1342,9 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-        c4x-* | tic4x-*)
-               os=-coff
-               ;;
+    c4x-* | tic4x-*)
+        os=-coff
+        ;;
        # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
@@ -1421,9 +1370,6 @@ case $basic_machine in
        m68*-cisco)
                os=-aout
                ;;
-        mep-*)
-               os=-elf
-               ;;
        mips*-cisco)
                os=-elf
                ;;
@@ -1442,9 +1388,6 @@ case $basic_machine in
        *-be)
                os=-beos
                ;;
-       *-haiku)
-               os=-haiku
-               ;;
        *-ibm)
                os=-aix
                ;;
@@ -1616,7 +1559,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit
+exit 0
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
index 9af03d4..0a9e661 100644 (file)
@@ -2060,6 +2060,9 @@ echo "command line was: $0 $@"
 
 
 
+
+
+
 # After checking to see that --srcdir is correct (which AC_INIT does)
 # check for some random other files that come later in the tar file,
 # to make sure everything is here.
@@ -2096,6 +2099,10 @@ done
 
 
 
+# Need to disable Objective C extensions in ANSI C on MacOS X to work
+# around an Apple-specific gcc bug.
+#
+
 
 ###############################################################################
 #
@@ -2124,18 +2131,6 @@ done
 
 ###############################################################################
 #
-#       Function to figure out how to turn off Objective C on MacOS X.
-#       (We have to do this to work around an Apple-specific gcc bug.)
-#
-###############################################################################
-
-
-
-
-
-
-###############################################################################
-#
 #       Function to figure out how to create directory trees.
 #
 ###############################################################################
@@ -3455,6 +3450,7 @@ else
        ac_cv_gcc_accepts_no_overlength=no
      else
        ac_cv_gcc_accepts_no_overlength=yes
+       CC="$CC -Wno-overlength-strings"
      fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_gcc_accepts_no_overlength" >&5
@@ -3475,6 +3471,7 @@ else
        ac_cv_gcc_accepts_no_decl_after=no
      else
        ac_cv_gcc_accepts_no_decl_after=yes
+       CC="$CC -Wdeclaration-after-statement"
      fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_gcc_accepts_no_decl_after" >&5
@@ -3483,7 +3480,6 @@ echo "${ECHO_T}$ac_cv_gcc_accepts_no_decl_after" >&6; }
   fi
 
 if test -n "$GCC"; then
-   if test -n "$GCC"; then
    { echo "$as_me:$LINENO: checking whether gcc accepts -no-cpp-precomp" >&5
 echo $ECHO_N "checking whether gcc accepts -no-cpp-precomp... $ECHO_C" >&6; }
 if test "${ac_cv_gcc_accepts_no_cpp_precomp+set}" = set; then
@@ -3496,6 +3492,7 @@ else
        ac_cv_gcc_accepts_no_cpp_precomp=no
      else
        ac_cv_gcc_accepts_no_cpp_precomp=yes
+       CC="$CC -no-cpp-precomp"
      fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_gcc_accepts_no_cpp_precomp" >&5
@@ -3503,13 +3500,6 @@ echo "${ECHO_T}$ac_cv_gcc_accepts_no_cpp_precomp" >&6; }
    ac_gcc_accepts_no_cpp_precomp="$ac_cv_gcc_accepts_no_cpp_precomp"
   fi
 
-   if test "$ac_gcc_accepts_no_cpp_precomp" = yes ; then
-     { echo "$as_me:$LINENO: result: Disabling Objective C extensions in ANSI C code." >&5
-echo "${ECHO_T}Disabling Objective C extensions in ANSI C code." >&6; }
-     CC="$CC -no-cpp-precomp"
-   fi
-  fi
-
 if test -n "$GCC"; then
    if test -n "$GCC"; then
    { echo "$as_me:$LINENO: checking whether gcc accepts -std=c89" >&5
@@ -3524,6 +3514,7 @@ else
        ac_cv_gcc_accepts_std=no
      else
        ac_cv_gcc_accepts_std=yes
+       CC="$CC -std=c89"
      fi
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_gcc_accepts_std" >&5
@@ -3552,7 +3543,8 @@ echo "${ECHO_T}Disabling C++ comments in ANSI C code." >&6; }
      # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
      # with -std=gnu89 but not with -std=c89.)
      #
-     CC="$CC -std=c89 -U__STRICT_ANSI__"
+     # $CC already contains "-std=c89" via AC_GCC_ACCEPTS_STD
+     CC="$CC -U__STRICT_ANSI__"
    else
      # The old way:
      CC="$CC -Wp,-lang-c89"
@@ -12140,7 +12132,7 @@ echo "${ECHO_T}not found ($d: no such directory)" >&6; }
 
 if test "$with_randr" = yes; then
 
-  # first check for Randr.h
+  # first check for Xrandr.h
 
   ac_save_CPPFLAGS="$CPPFLAGS"
   if test \! -z "$includedir" ; then
 #define HAVE_RANDR 1
 _ACEOF
 
+
+    # Now check for version 1.2 in the same 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"
+
+  CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS`
+  LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS`
+  { echo "$as_me:$LINENO: checking for XRRGetOutputInfo in -lc" >&5
+echo $ECHO_N "checking for XRRGetOutputInfo in -lc... $ECHO_C" >&6; }
+if test "${ac_cv_lib_c_XRRGetOutputInfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $SAVER_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char XRRGetOutputInfo ();
+int
+main ()
+{
+return XRRGetOutputInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -rf conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -rf conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_c_XRRGetOutputInfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_c_XRRGetOutputInfo=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_XRRGetOutputInfo" >&5
+echo "${ECHO_T}$ac_cv_lib_c_XRRGetOutputInfo" >&6; }
+if test $ac_cv_lib_c_XRRGetOutputInfo = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_RANDR_12 1
+_ACEOF
+
+else
+  true
+fi
+
+  CPPFLAGS="$ac_save_CPPFLAGS"
+  LDFLAGS="$ac_save_LDFLAGS"
+#  LIBS="$ac_save_LIBS"
+
   fi
 
+
 elif test "$with_randr" != no; then
   echo "error: must be yes or no: --with-randr-ext=$with_randr"
   exit 1
@@ -16673,7 +16761,7 @@ if test "${ac_cv_mesagl_version_string+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16680 "configure"
+#line 16768 "configure"
 #include "confdefs.h"
 #include <GL/gl.h>
 #ifndef MESA_MAJOR_VERSION
@@ -19890,9 +19978,11 @@ echo "${ECHO_T}no" >&6; }
 
     #### Could use some more defaults here...
     for f in \
-      "/usr/X11R6/lib/X11/doc/README"          \
-      "/usr/share/doc/xserver-common/copyright"        \
-      "/usr/X11R6/README"                      \
+      "/usr/X11R6/lib/X11/doc/README"             \
+      "/usr/share/doc/xserver-common/copyright"           \
+      "/usr/share/doc/xserver-xorg-core/copyright" \
+      "/usr/X11R6/README"                         \
+      "/usr/share/doc/debian/debian-manifesto"     \
     ; do
       if test -z "$with_textfile"; then
         { echo "$as_me:$LINENO: checking for text file $f" >&5
@@ -21883,8 +21973,9 @@ if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
   pgl="$preferred_mesagl"
 
   if test "$ac_mesagl_version" = unknown; then
-    warnL "Unable to determine the MesaGL version number!"
-    warn2 "Make sure you are using version $preferred_mesagl or newer."
+    true
+    # warnL "Unable to determine the MesaGL version number!"
+    # warn2 "Make sure you are using version $preferred_mesagl or newer."
 
   elif test \! "$ac_mesagl_version" -gt 2006; then
     warnL "MesaGL version number is $mgv --"
@@ -22035,7 +22126,7 @@ if test -z "$RPM_PACKAGE_VERSION" ; then
 
   if test \! -z "$rpmv" ; then
     rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
-    rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/attraction$@\1@p'`
+    rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'`
 
     warning=no
     warnL "There is already an installed RPM of xscreensaver $rpmv"
@@ -22058,6 +22149,31 @@ if test -z "$RPM_PACKAGE_VERSION" ; then
   fi
 fi
 
+# Also warn if there's a Debian package installed.
+#
+debnames="xscreensaver xscreensaver-data xscreensaver-data-extra"
+debv=''
+for dpkg in $debnames ; do
+  if test -z "$debv"; then
+    debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'`
+  fi
+done
+
+if test \! -z "$debv" ; then
+  debbdir=`dpkg -L $debnames 2>/dev/null | \
+            sed -n 's@^\(.*/bin\)/xscreensaver$@\1@p'`
+  debhdir=`dpkg -L $debnames 2>/dev/null | \
+            sed -n 's@^\(.*\)/popsquares$@\1@p'`
+
+  warning=no
+  warnL "There is already an installed dpkg of xscreensaver"
+  warn2 "version \"$debv\" on this system."
+  echo ""
+  warn2 "The dpkg was installed in $debbdir/,"
+  warn2 "with demos in $debhdir/."
+fi
+
+
 if test "${bindir}" = "${HACKDIR}" ; then
   do_dir_warning=yes
 fi
index 9a049b5..d8c98ab 100644 (file)
@@ -106,6 +106,9 @@ AH_TEMPLATE([HAVE_RANDR],
            possibly elsewhere.  (It's available if the file
            /usr/include/X11/extensions/Xrandr.h exists.)])
 
+AH_TEMPLATE([HAVE_RANDR_12],
+           [Define this if the RANDR library is version 1.2 or newer.])
+
 AH_TEMPLATE([HAVE_PROC_INTERRUPTS],
            [Define this if you have a Linux-like /proc/interrupts file which
            can be examined to determine when keyboard activity has
@@ -389,6 +392,7 @@ AC_DEFUN(AC_CHECK_GCC_ARG,
        ac_cv_gcc_accepts_[$1]=no
      else
        ac_cv_gcc_accepts_[$1]=yes
+       CC="$CC [$2]"
      fi])
    ac_gcc_accepts_[$1]="$ac_cv_gcc_accepts_[$1]"
   fi
@@ -400,6 +404,11 @@ AC_DEFUN(AC_NO_LONG_STRING_WARNINGS,
 AC_DEFUN(AC_NO_MISPLACED_DECLARATIONS,
          [AC_CHECK_GCC_ARG(no_decl_after, -Wdeclaration-after-statement)])
 
+# Need to disable Objective C extensions in ANSI C on MacOS X to work
+# around an Apple-specific gcc bug.
+#
+AC_DEFUN(AC_NO_OBJECTIVE_C,
+         [AC_CHECK_GCC_ARG(no_cpp_precomp, -no-cpp-precomp)])
 
 ###############################################################################
 #
@@ -447,7 +456,8 @@ AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
      # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
      # with -std=gnu89 but not with -std=c89.)
      #
-     CC="$CC -std=c89 -U__STRICT_ANSI__"
+     # $CC already contains "-std=c89" via AC_GCC_ACCEPTS_STD
+     CC="$CC -U__STRICT_ANSI__"
    else
      # The old way:
      CC="$CC -Wp,-lang-c89"
@@ -458,27 +468,6 @@ AC_DEFUN(AC_NO_CPLUSPLUS_COMMENTS_IN_C_CODE,
 
 ###############################################################################
 #
-#       Function to figure out how to turn off Objective C on MacOS X.
-#       (We have to do this to work around an Apple-specific gcc bug.)
-#
-###############################################################################
-
-AC_DEFUN(AC_GCC_ACCEPTS_NO_CPP_PRECOMP,
-         [AC_CHECK_GCC_ARG(no_cpp_precomp, -no-cpp-precomp)])
-
-AC_DEFUN(AC_NO_OBJECTIVE_C,
- [if test -n "$GCC"; then
-   AC_GCC_ACCEPTS_NO_CPP_PRECOMP
-   if test "$ac_gcc_accepts_no_cpp_precomp" = yes ; then
-     AC_MSG_RESULT(Disabling Objective C extensions in ANSI C code.)
-     CC="$CC -no-cpp-precomp"
-   fi
-  fi
-])
-
-
-###############################################################################
-#
 #       Function to figure out how to create directory trees.
 #
 ###############################################################################
@@ -1667,7 +1656,7 @@ HANDLE_X_PATH_ARG(with_randr, --with-randr-ext, RANDR)
 
 if test "$with_randr" = yes; then
 
-  # first check for Randr.h
+  # first check for Xrandr.h
   AC_CHECK_X_HEADER(X11/extensions/Xrandr.h, [have_randr=yes],,
                     [#include <X11/Xlib.h>])
 
@@ -1696,8 +1685,13 @@ if test "$with_randr" = yes; then
   # if that succeeded, then we've really got it.
   if test "$have_randr" = yes; then
     AC_DEFINE(HAVE_RANDR)
+
+    # Now check for version 1.2 in the same libs.
+    AC_CHECK_X_LIB(c, XRRGetOutputInfo, [AC_DEFINE(HAVE_RANDR_12)],
+                   [true], $SAVER_LIBS)
   fi
 
+
 elif test "$with_randr" != no; then
   echo "error: must be yes or no: --with-randr-ext=$with_randr"
   exit 1
@@ -3414,9 +3408,11 @@ case "$with_textfile" in
 
     #### Could use some more defaults here...
     for f in \
-      "/usr/X11R6/lib/X11/doc/README"          \
-      "/usr/share/doc/xserver-common/copyright"        \
-      "/usr/X11R6/README"                      \
+      "/usr/X11R6/lib/X11/doc/README"             \
+      "/usr/share/doc/xserver-common/copyright"           \
+      "/usr/share/doc/xserver-xorg-core/copyright" \
+      "/usr/X11R6/README"                         \
+      "/usr/share/doc/debian/debian-manifesto"     \
     ; do
       if test -z "$with_textfile"; then
         AC_MSG_CHECKING([for text file $f])
@@ -4035,8 +4031,9 @@ if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
   pgl="$preferred_mesagl"
 
   if test "$ac_mesagl_version" = unknown; then
-    warnL "Unable to determine the MesaGL version number!"
-    warn2 "Make sure you are using version $preferred_mesagl or newer."
+    true
+    # warnL "Unable to determine the MesaGL version number!"
+    # warn2 "Make sure you are using version $preferred_mesagl or newer."
 
   elif test \! "$ac_mesagl_version" -gt 2006; then
     warnL "MesaGL version number is $mgv --"
@@ -4182,7 +4179,7 @@ if test -z "$RPM_PACKAGE_VERSION" ; then
 
   if test \! -z "$rpmv" ; then
     rpmbdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
-    rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/attraction$@\1@p'`
+    rpmhdir=`rpm -ql $rpmnames | sed -n 's@^\(.*\)/popsquares$@\1@p'`
 
     warning=no
     warnL "There is already an installed RPM of xscreensaver $rpmv"
@@ -4205,6 +4202,31 @@ if test -z "$RPM_PACKAGE_VERSION" ; then
   fi
 fi
 
+# Also warn if there's a Debian package installed.
+#
+debnames="xscreensaver xscreensaver-data xscreensaver-data-extra"
+debv=''
+for dpkg in $debnames ; do
+  if test -z "$debv"; then
+    debv=`dpkg -s $dpkg 2>/dev/null | sed -n 's/^Version: \(.*\)$/\1/p'`
+  fi
+done
+
+if test \! -z "$debv" ; then
+  debbdir=`dpkg -L $debnames 2>/dev/null | \
+            sed -n 's@^\(.*/bin\)/xscreensaver$@\1@p'`
+  debhdir=`dpkg -L $debnames 2>/dev/null | \
+            sed -n 's@^\(.*\)/popsquares$@\1@p'`
+
+  warning=no
+  warnL "There is already an installed dpkg of xscreensaver"
+  warn2 "version \"$debv\" on this system."
+  echo ""
+  warn2 "The dpkg was installed in $debbdir/,"
+  warn2 "with demos in $debhdir/."
+fi
+
+
 if test "${bindir}" = "${HACKDIR}" ; then
   do_dir_warning=yes
 fi
index d9e4d75..1350400 100644 (file)
@@ -116,10 +116,10 @@ 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 test-vp.c   \
-                 test-randr.c  xdpyinfo.c  test-mlstring.c
+                 test-randr.c  xdpyinfo.c  test-mlstring.c test-screens.c
 TEST_EXES      = test-passwd   test-uid    test-xdpms      test-grab   \
                  test-apm      test-fade   test-xinerama   test-vp     \
-                 test-randr    xdpyinfo    test-mlstring
+                 test-randr    xdpyinfo    test-mlstring   test-screens
 
 MOTIF_LIBS     = @MOTIF_LIBS@ @XPM_LIBS@ $(XMU_LIBS)
 GTK_LIBS       = @GTK_LIBS@ $(XMU_LIBS)
@@ -147,9 +147,9 @@ LOGO                = $(ICON_SRC)/logo-50.xpm
 GTK_ICONS      = $(ICON_SRC)/screensaver-*.png
 
 DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
-                 $(UTILS_SRC)/visual.c
+                 $(UTILS_SRC)/visual.c $(XMU_SRCS)
 DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
-                 $(UTILS_BIN)/visual.o
+                 $(UTILS_BIN)/visual.o $(XMU_OBJS)
 
 SAVER_UTIL_SRCS        = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
                  $(UTILS_SRC)/logo.c $(UTILS_SRC)/yarandom.c \
@@ -179,24 +179,24 @@ GETIMG_OBJS       = $(GETIMG_OBJS_1) \
                  $(UTILS_BIN)/logo.o $(UTILS_BIN)/minixpm.o prefs.o \
                  $(XMU_OBJS)
 
-SAVER_SRCS_1   = xscreensaver.c windows.c timers.c subprocs.c exec.c \
-                 xset.c splash.c setuid.c stderr.c mlstring.c
-SAVER_OBJS_1   = xscreensaver.o windows.o timers.o subprocs.o exec.o \
-                 xset.o splash.o setuid.o stderr.o mlstring.o
+SAVER_SRCS_1   = xscreensaver.c windows.c screens.c timers.c subprocs.c \
+                 exec.c xset.c splash.c setuid.c stderr.c mlstring.c
+SAVER_OBJS_1   = xscreensaver.o windows.o screens.o timers.o subprocs.o \
+                 exec.o xset.o splash.o setuid.o stderr.o mlstring.o
 
 SAVER_SRCS     = $(SAVER_SRCS_1) prefs.c dpms.c $(LOCK_SRCS) \
-                 $(SAVER_UTIL_SRCS) $(GL_SRCS) $(XMU_SRCS)
+                 $(SAVER_UTIL_SRCS) $(GL_SRCS)
 SAVER_OBJS     = $(SAVER_OBJS_1) prefs.o dpms.o $(LOCK_OBJS) \
-                 $(SAVER_UTIL_OBJS) $(GL_OBJS) $(XMU_OBJS)
+                 $(SAVER_UTIL_OBJS) $(GL_OBJS)
 
 CMD_SRCS       = remote.c xscreensaver-command.c
 CMD_OBJS       = remote.o xscreensaver-command.o
 
-DEMO_SRCS_1    = prefs.c dpms.c $(XMU_SRCS)
-DEMO_OBJS_1    = prefs.o dpms.o $(XMU_OBJS)
+DEMO_SRCS_1    = prefs.c dpms.c
+DEMO_OBJS_1    = prefs.o dpms.o
 
-DEMO_SRCS      = prefs.c dpms.c remote.c exec.c $(DEMO_UTIL_SRCS)
-DEMO_OBJS      = prefs.o dpms.o remote.o exec.o $(DEMO_UTIL_OBJS)
+DEMO_SRCS      = $(DEMO_SRCS_1) remote.c exec.c $(DEMO_UTIL_SRCS)
+DEMO_OBJS      = $(DEMO_OBJS_1) remote.o exec.o $(DEMO_UTIL_OBJS)
 
 PDF2JPEG_SRCS  = pdf2jpeg.m
 PDF2JPEG_OBJS  = pdf2jpeg.o
@@ -453,7 +453,7 @@ install-pam:
  $$e "  ####################################################################";\
  $$e ""                                                                             ;\
          fi ;                                                          \
-       elif [ -f $$conf ]; then                                        \
+       elif [ -f $$conf -a "x$$dest" != "x" ]; then                    \
          if ( grep $$dest $$conf >/dev/null ); then                    \
           echo "$$conf unchanged: already has an entry for $$dest" ;   \
          else                                                          \
@@ -498,7 +498,7 @@ install-gnome:: screensaver-properties.desktop
             echo $(INSTALL_DIRS) "$(install_prefix)$(GTK_APPDIR)"           ;\
                  $(INSTALL_DIRS) "$(install_prefix)$(GTK_APPDIR)"           ;\
           fi                                                                ;\
-          name2=gnome-screensaver-properties.desktop                        ;\
+          name2=xscreensaver-properties.desktop                             ;\
           echo $(INSTALL_DATA) screensaver-properties.desktop                \
                  $(install_prefix)$(GTK_APPDIR)/$$name2                     ;\
                $(INSTALL_DATA) screensaver-properties.desktop                \
@@ -571,7 +571,7 @@ install-gnome:: xscreensaver-demo.glade2
 # into /usr/share/applications/
 uninstall-gnome::
        @if [ "$(GTK_DATADIR)" != "" ]; then                                  \
-          f=gnome-screensaver-properties.desktop                             ;\
+          f=xscreensaver-properties.desktop                                  ;\
           echo rm -f $(install_prefix)$(GTK_APPDIR)/$$f                      ;\
                rm -f $(install_prefix)$(GTK_APPDIR)/$$f                      ;\
         fi
@@ -846,6 +846,11 @@ TEST_FADE_OBJS = test-fade.o $(UTILS_SRC)/fade.o $(DEMO_UTIL_OBJS)
 test-fade: test-fade.o $(UTILS_BIN)/fade.o
        $(CC) $(LDFLAGS) -o $@ $(TEST_FADE_OBJS) $(SAVER_LIBS)
 
+TEST_SCREENS_OBJS = test-screens.o $(DEMO_UTIL_OBJS)
+test-screens.o: screens.c
+test-screens: test-screens.o
+       $(CC) $(LDFLAGS) -o $@ $(TEST_SCREENS_OBJS) $(SAVER_LIBS)
+
 
 xdpyinfo.o: xdpyinfo.c
        $(CC) -c $(INCLUDES) -DHAVE_GLX $(CFLAGS) $(X_CFLAGS) \
@@ -913,6 +918,11 @@ prefs.o: $(srcdir)/types.h
 prefs.o: $(UTILS_SRC)/resources.h
 remote.o: ../config.h
 remote.o: $(srcdir)/remote.h
+screens.o: ../config.h
+screens.o: $(srcdir)/prefs.h
+screens.o: $(srcdir)/types.h
+screens.o: $(UTILS_SRC)/visual.h
+screens.o: $(srcdir)/xscreensaver.h
 setuid.o: ../config.h
 setuid.o: $(srcdir)/prefs.h
 setuid.o: $(srcdir)/types.h
@@ -954,6 +964,12 @@ test-passwd.o: $(UTILS_SRC)/version.h
 test-passwd.o: $(UTILS_SRC)/visual.h
 test-passwd.o: $(srcdir)/xscreensaver.h
 test-randr.o: ../config.h
+test-screens.o: ../config.h
+test-screens.o: $(srcdir)/prefs.h
+test-screens.o: $(srcdir)/screens.c
+test-screens.o: $(srcdir)/types.h
+test-screens.o: $(UTILS_SRC)/visual.h
+test-screens.o: $(srcdir)/xscreensaver.h
 test-uid.o: ../config.h
 test-vp.o: ../config.h
 test-xdpms.o: ../config.h
index 3798dbe..60166e6 100644 (file)
@@ -4,8 +4,8 @@
 !            a screen saver and locker for the X window system
 !                            by Jamie Zawinski
 !
-!                              version 5.05
-!                              01-Mar-2008
+!                              version 5.06
+!                              05-Jul-2008
 !
 ! See "man xscreensaver" for more info.  The latest version is always
 ! available at http://www.jwz.org/xscreensaver/
@@ -60,7 +60,7 @@
 *textLiteral:          XScreenSaver
 *textFile:             @DEFAULT_TEXT_FILE@
 *textProgram:          fortune
-*textURL:              http://www.livejournal.com/stats/latest-rss.bml
+*textURL:              http://planet.debian.org/rss20.xml
 
 *overlayTextForeground:        #FFFF00
 *overlayTextBackground:        #000000
@@ -91,16 +91,20 @@ GetViewPortIsFullOfLies: False
 !
 ! And there are so very many options to choose from!
 !
+*loadURL: x-www-browser '%s'
+*manualCommand: x-terminal-emulator -title '%s manual' \
+               -e '/bin/sh -c "man %s; read foo"'
+!
 !   Gnome 2.4, 2.6: (yelp can't display man pages, as of 2.6.3)
 !
-@GNOME24@*loadURL: @WITH_BROWSER@ '%s'
-@GNOME24@*manualCommand: gnome-terminal --title '%s manual' \
+@GNOME24@*loadURL: x-www-browser '%s'
+@GNOME24@*manualCommand: x-terminal-emulator -title '%s manual' \
 @GNOME24@              --command '/bin/sh -c "man %s; read foo"'
 !
 !   Gnome 2.2:
 !
-@GNOME22@*loadURL: gnome-url-show '%s'
-@GNOME22@*manualCommand: gnome-terminal --title '%s manual' \
+@GNOME22@*loadURL: x-www-browser '%s'
+@GNOME22@*manualCommand: x-terminal-emulator -title '%s manual' \
 @GNOME22@              --command '/bin/sh -c "man %s; read foo"'
 !
 !   Gnome 1.4:
@@ -110,8 +114,8 @@ GetViewPortIsFullOfLies: False
 !
 !   non-Gnome systems:
 !
-@NOGNOME@*loadURL: firefox '%s' || mozilla '%s' || netscape '%s'
-@NOGNOME@*manualCommand: xterm -sb -fg black -bg gray75 -T '%s manual' \
+@NOGNOME@*loadURL: x-www-browser '%s'
+@NOGNOME@*manualCommand: x-terminal-emulator -title '%s manual' \
 @NOGNOME@                  -e /bin/sh -c 'man "%s" ; read foo'
 
 
@@ -125,9 +129,11 @@ GetViewPortIsFullOfLies: False
 
 
 ! This command is executed by the "New Login" button on the lock dialog.
-! (That button does not appear if this program does not exist.)
+! (That button does not appear on the dialog if this program does not exist.)
+! For Gnome: probably "gdmflexiserver -ls".  KDE, probably "kdmctl reserve".
 !
-@NEW_LOGIN_COMMAND_P@*newLoginCommand: @NEW_LOGIN_COMMAND@
+! @NEW_LOGIN_COMMAND_P@*newLoginCommand:       @NEW_LOGIN_COMMAND@
+*newLoginCommand:      gdmflexiserver -l -a -c FLEXI_XSERVER
 
 
 ! Turning on "installColormap" on 8-bit systems interacts erratically with
@@ -464,10 +470,11 @@ XScreenSaver.bourneShell:         /bin/sh
 *Dialog.shadowThickness:       2
 
 *passwd.heading.label:         XScreenSaver %s
-*passwd.body.label:            This screen is locked.
+*passwd.body.label:            Please enter your password.
 *passwd.unlock.label:          OK
 *passwd.login.label:           New Login
 *passwd.user.label:            Username:
+*passwd.passwd.label:          Password:
 *passwd.thermometer.width:     8
 *passwd.asterisks:              True
 *passwd.uname:                  True
diff --git a/xscreensaver/driver/XScreenSaver_Xm_ad.h b/xscreensaver/driver/XScreenSaver_Xm_ad.h
deleted file mode 100644 (file)
index 371e0a2..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-"*fontList:                       *-helvetica-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*demoDialog*label1.fontList:     *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1",
-"*cmdText.fontList:                 *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*label0.fontList:                  *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
-"XScreenSaver*doc.fontList:       *-helvetica-medium-r-*-*-*-100-*-*-*-iso8859-1",
-"*foreground:                  #000000",
-"*background:                  #C0C0C0",
-"*XmTextField.foreground:      #000000",
-"*XmTextField.background:      #FFFFFF",
-"*list.foreground:             #000000",
-"*list.background:             #FFFFFF",
-"*ApplicationShell.title:      XScreenSaver",
-"*warning.title:                       XScreenSaver",
-"*warning_popup.title:         XScreenSaver",
-"*allowShellResize:            True",
-"*autoUnmanage:                        False",
-"*menubar*file.labelString:    File",
-"*menubar*file.mnemonic:               F",
-"*file.blank.labelString:      Blank Screen Now",
-"*file.blank.mnemonic:         B",
-"*file.lock.labelString:               Lock Screen Now",
-"*file.lock.mnemonic:          L",
-"*file.kill.labelString:               Kill Daemon",
-"*file.kill.mnemonic:          K",
-"*file.restart.labelString:    Restart Daemon",
-"*file.restart.mnemonic:               R",
-"*file.exit.labelString:               Exit",
-"*file.exit.mnemonic:          E",
-"*menubar*edit.labelString:    Edit",
-"*menubar*edit.mnemonic:               E",
-"*edit.cut.labelString:                Cut",
-"*edit.cut.mnemonic:           u",
-"*edit.copy.labelString:               Copy",
-"*edit.copy.mnemonic:          C",
-"*edit.paste.labelString:      Paste",
-"*edit.paste.mnemonic:         P",
-"*menubar*help.labelString:    Help",
-"*menubar*help.mnemonic:               H",
-"*help.about.labelString:      About...",
-"*help.about.mnemonic:         A",
-"*help.docMenu.labelString:    Documentation...",
-"*help.docMenu.mnemonic:               D",
-"*demoTab.marginWidth:         10",
-"*optionsTab.marginWidth:      10",
-"*XmScrolledWindow.topOffset:  10",
-"*XmScrolledWindow.leftOffset: 10",
-"*demoTab.topOffset:           4",
-"*form1.bottomOffset:          10",
-"*form3.leftOffset:            10",
-"*form3.rightOffset:           10",
-"*frame.topOffset:             10",
-"*frame.bottomOffset:          10",
-"*enabled.topOffset:           10",
-"*visLabel.topOffset:          10",
-"*combo.topOffset:             10",
-"*form4.bottomOffset:          4",
-"*hr.bottomOffset:             4",
-"*XmComboBox.marginWidth:      0",
-"*XmComboBox.marginHeight:     0",
-"*demo.marginWidth:            30",
-"*demo.marginHeight:           4",
-"*man.marginWidth:             10",
-"*man.marginHeight:            4",
-"*down.leftOffset:             40",
-"*down.marginWidth:            4",
-"*down.marginHeight:           4",
-"*up.marginWidth:              4",
-"*up.marginHeight:             4",
-"*frame.traversalOn:           False",
-"*list.automaticSelection:     True",
-"*list.visibleItemCount:               20",
-"*doc.columns:                 60",
-"*combo.columns:                       11",
-"*demoTab.labelString:         Graphics Demos",
-"*optionsTab.labelString:      Screensaver Options",
-"*down.labelString:            \\\\/ ",
-"*up.labelString:              /\\\\ ",
-"*frameLabel.labelString:      ",
-"*cmdLabel.labelString:                Command Line:",
-"*cmdLabel.alignment:          ALIGNMENT_BEGINNING",
-"*enabled.labelString:         Enabled",
-"*visLabel.labelString:                Visual:",
-"*visLabel.alignment:          ALIGNMENT_END",
-"*visLabel.leftOffset:         20",
-"*demo.labelString:            Demo",
-"*man.labelString:             Documentation...",
-"*done.labelString:            Quit",
-"*preferencesLabel.labelString:        XScreenSaver Parameters",
-"*timeoutLabel.labelString:    Saver Timeout",
-"*cycleLabel.labelString:      Cycle Timeout",
-"*fadeSecondsLabel.labelString:        Fade Duration",
-"*fadeTicksLabel.labelString:  Fade Ticks",
-"*lockLabel.labelString:               Lock Timeout",
-"*passwdLabel.labelString:     Password Timeout",
-"*preferencesForm*XmTextField.columns: 8",
-"*verboseToggle.labelString:   Verbose",
-"*cmapToggle.labelString:      Install Colormap",
-"*fadeToggle.labelString:      Fade Colormap",
-"*unfadeToggle.labelString:    Unfade Colormap",
-"*lockToggle.labelString:      Require Password",
-"*OK.marginWidth:              30",
-"*OK.marginHeight:             4",
-"*OK.leftOffset:                       10",
-"*OK.bottomOffset:             10",
-"*Cancel.marginWidth:          30",
-"*Cancel.marginHeight:         4",
-"*Cancel.rightOffset:          10",
-"*Cancel.bottomOffset:         10",
index e556203..73c586c 100644 (file)
@@ -12,8 +12,8 @@
 "*dpmsOff:             4:00:00",
 "*grabDesktopImages:   True",
 "*grabVideoFrames:     False",
-"*chooseRandomImages:  True",
-"*imageDirectory:      /Library/Desktop Pictures/",
+"*chooseRandomImages:  False",
+"*imageDirectory:      ",
 "*nice:                        10",
 "*memoryLimit:         0",
 "*lock:                        False",
@@ -30,9 +30,9 @@
 "*ignoreUninstalledPrograms: False",
 "*textMode:            file",
 "*textLiteral:         XScreenSaver",
-"*textFile:            ",
+"*textFile:            /usr/share/doc/xserver-xorg-core/copyright",
 "*textProgram:         fortune",
-"*textURL:             http://www.livejournal.com/stats/latest-rss.bml",
+"*textURL:             http://planet.debian.org/rss20.xml",
 "*overlayTextForeground:       #FFFF00",
 "*overlayTextBackground:       #000000",
 "*overlayStderr:               True",
 "*demoCommand: xscreensaver-demo",
 "*prefsCommand: xscreensaver-demo -prefs",
 "*helpURL: http://www.jwz.org/xscreensaver/man.html",
-"*loadURL: firefox '%s' || mozilla '%s' || netscape '%s'",
-"*manualCommand: xterm -sb -fg black -bg gray75 -T '%s manual' \
-                   -e /bin/sh -c 'man \"%s\" ; read foo'",
+"*loadURL: x-www-browser '%s'",
+"*manualCommand: x-terminal-emulator -title '%s manual' \
+               -e '/bin/sh -c \"man %s; read foo\"'",
+"*loadURL: x-www-browser '%s'",
+"*manualCommand: x-terminal-emulator -title '%s manual' \
+               --command '/bin/sh -c \"man %s; read foo\"'",
 "*dateFormat:          %d-%b-%y (%a); %I:%M %p",
+"*newLoginCommand:     gdmflexiserver -l -a -c FLEXI_XSERVER",
 "*installColormap:     True",
 "*programs:                                                                  \
                 \"Qix (solid)\"        qix -root -solid -segments 100              \\n\
                                  'vidwhacker -stdin -stdout'               \\n\
 - default-n:                   vidwhacker -root                            \\n\
                                                                              \
-          GL:                  gears -root                                 \\n\
-          GL:                  superquadrics -root                         \\n\
-          GL:                  morph3d -root                               \\n\
-          GL:                  cage -root                                  \\n\
-          GL:                  moebius -root                               \\n\
-          GL:                  stairs -root                                \\n\
-          GL:                  pipes -root                                 \\n\
-          GL:                  sproingies -root                            \\n\
-          GL:                  rubik -root                                 \\n\
-          GL:                  atlantis -root                              \\n\
-          GL:                  lament -root                                \\n\
-          GL:                  bubble3d -root                              \\n\
-          GL:                  glplanet -root                              \\n\
-          GL:                  flurry -root                                \\n\
-          GL:                  pulsar -root                                \\n\
+-         GL:                  gears -root                                 \\n\
+-         GL:                  superquadrics -root                         \\n\
+-         GL:                  morph3d -root                               \\n\
+-         GL:                  cage -root                                  \\n\
+-         GL:                  moebius -root                               \\n\
+-         GL:                  stairs -root                                \\n\
+-         GL:                  pipes -root                                 \\n\
+-         GL:                  sproingies -root                            \\n\
+-         GL:                  rubik -root                                 \\n\
+-         GL:                  atlantis -root                              \\n\
+-         GL:                  lament -root                                \\n\
+-         GL:                  bubble3d -root                              \\n\
+-         GL:                  glplanet -root                              \\n\
+-         GL:                  flurry -root                                \\n\
+-         GL:                  pulsar -root                                \\n\
 -         GL:     \"Pulsar (textures)\"                                              \
                                  pulsar -root -texture -mipmap               \
                                  -texture_quality -light -fog              \\n\
 -         GL:                  extrusion -root                             \\n\
-          GL:                  sierpinski3d -root                          \\n\
-          GL:                  menger -root                                \\n\
-          GL:                  gflux -root                                 \\n\
-          GL:   \"GFlux (grab)\"       gflux -root -mode grab                      \\n\
-          GL:                  stonerview -root                            \\n\
-          GL:                  starwars -root                              \\n\
-          GL:                  gltext -root                                \\n\
-          GL:  \"GLText (clock)\" gltext -text \"%A%n%d %b %Y%n%r\" -root          \\n\
-          GL:                  molecule -root                              \\n\
-          GL:                  dangerball -root                            \\n\
-          GL:                  circuit -root                               \\n\
-          GL:                  engine -root                                \\n\
-          GL:                  flipscreen3d -root                          \\n\
-          GL:                  glsnake -root                               \\n\
-          GL:                  boxed -root                                 \\n\
+-         GL:                  sierpinski3d -root                          \\n\
+-         GL:                  menger -root                                \\n\
+-         GL:                  gflux -root                                 \\n\
+-         GL:   \"GFlux (grab)\"       gflux -root -mode grab                      \\n\
+-         GL:                  stonerview -root                            \\n\
+-         GL:                  starwars -root                              \\n\
+-         GL:                  gltext -root                                \\n\
+-         GL:  \"GLText (clock)\" gltext -text \"%A%n%d %b %Y%n%r\" -root          \\n\
+-         GL:                  molecule -root                              \\n\
+-         GL:                  dangerball -root                            \\n\
+-         GL:                  circuit -root                               \\n\
+-         GL:                  engine -root                                \\n\
+-         GL:                  flipscreen3d -root                          \\n\
+-         GL:                  glsnake -root                               \\n\
+-         GL:                  boxed -root                                 \\n\
 -         GL:                  glforestfire -root                          \\n\
 -         GL:  \"GLForestFire (rain)\" glforestfire -root -count 0         \\n\
 -         GL:                  sballs -root                                \\n\
-          GL:                  cubenetic -root                             \\n\
-          GL:                  spheremonics -root                          \\n\
-          GL:                  lavalite -root                              \\n\
-          GL:                  queens -root                                \\n\
-          GL:                  endgame -root                               \\n\
+-         GL:                  cubenetic -root                             \\n\
+-         GL:                  spheremonics -root                          \\n\
+-         GL:                  lavalite -root                              \\n\
+-         GL:                  queens -root                                \\n\
+-         GL:                  endgame -root                               \\n\
 -         GL:                  glblur -root                                \\n\
-          GL:                  atunnel -root                               \\n\
-          GL:                  flyingtoasters -root                        \\n\
-          GL:                  bouncingcow -root                           \\n\
-          GL:                  jigglypuff -root                            \\n\
-          GL:                  klein -root                                 \\n\
-          GL:                  hypertorus -root                            \\n\
-          GL:                  glmatrix -root                              \\n\
-          GL:                  cubestorm -root                             \\n\
-          GL:                  glknots -root                               \\n\
-          GL:                  blocktube -root                             \\n\
-          GL:                  flipflop -root                              \\n\
-          GL:                  antspotlight -root                          \\n\
+-         GL:                  atunnel -root                               \\n\
+-         GL:                  flyingtoasters -root                        \\n\
+-         GL:                  bouncingcow -root                           \\n\
+-         GL:                  jigglypuff -root                            \\n\
+-         GL:                  klein -root                                 \\n\
+-         GL:                  hypertorus -root                            \\n\
+-         GL:                  glmatrix -root                              \\n\
+-         GL:                  cubestorm -root                             \\n\
+-         GL:                  glknots -root                               \\n\
+-         GL:                  blocktube -root                             \\n\
+-         GL:                  flipflop -root                              \\n\
+-         GL:                  antspotlight -root                          \\n\
 -         GL:                  glslideshow -root                           \\n\
-          GL:                  polytopes -root                             \\n\
-          GL:                  gleidescope -root                           \\n\
+-         GL:                  polytopes -root                             \\n\
+-         GL:                  gleidescope -root                           \\n\
 -         GL:                  mirrorblob -root                            \\n\
-          GL:      \"MirrorBlob (color only)\"                               \
+-         GL:      \"MirrorBlob (color only)\"                               \
                                 mirrorblob -root -colour -no-texture       \\n\
-          GL:                  blinkbox -root                              \\n\
-          GL:                  noof -root                                  \\n\
-          GL:                  polyhedra -root                             \\n\
+-         GL:                  blinkbox -root                              \\n\
+-         GL:                  noof -root                                  \\n\
+-         GL:                  polyhedra -root                             \\n\
 -         GL:                  antinspect -root                            \\n\
-          GL:                  providence -root                            \\n\
-          GL:  \"Pinion (large gears)\"        pinion -root                        \\n\
-          GL:  \"Pinion (small gears)\"        pinion -root -size 0.2 -scroll 0.3  \\n\
-          GL:                  boing -root -lighting -smooth               \\n\
+-         GL:                  providence -root                            \\n\
+-         GL:  \"Pinion (large gears)\"        pinion -root                        \\n\
+-         GL:  \"Pinion (small gears)\"        pinion -root -size 0.2 -scroll 0.3  \\n\
+-         GL:                  boing -root -lighting -smooth               \\n\
 -         GL:                  carousel -root                              \\n\
-          GL:                  fliptext -root                              \\n\
+-         GL:                  fliptext -root                              \\n\
 -         GL:                  antmaze -root                               \\n\
-          GL:                  tangram -root                               \\n\
-          GL:                  crackberg -root                             \\n\
-          GL:                  glhanoi -root                               \\n\
-          GL:                  cube21 -root                                \\n\
-          GL:                  timetunnel -root                            \\n\
-          GL:                  juggler3d -root                             \\n\
-          GL:                  topblock -root                              \\n\
-          GL:                  glschool -root                              \\n\
-          GL:                  glcells -root                               \\n\
-          GL:                  voronoi -root                               \\n\
-          GL:                  moebiusgears -root                          \\n\
-          GL:                  lockward -root                              \\n\
-          GL:                  cubicgrid -root                             \\n\
-          GL:                  hypnowheel -root                            \\n\
-          GL:  \"Hypnowheel (dense)\"  hypnowheel -root -count 3 -layers 50 \\n\
-          GL:  \"Hypnowheel (trifoil)\"        hypnowheel -root -count 3 -layers 2 -speed 9 -twist 9 -wander \\n\
+-         GL:                  tangram -root                               \\n\
+-         GL:                  crackberg -root                             \\n\
+-         GL:                  glhanoi -root                               \\n\
+-         GL:                  cube21 -root                                \\n\
+-         GL:                  timetunnel -root                            \\n\
+-         GL:                  juggler3d -root                             \\n\
+-         GL:                  topblock -root                              \\n\
+-         GL:                  glschool -root                              \\n\
+-         GL:                  glcells -root                               \\n\
+-         GL:                  voronoi -root                               \\n\
+-         GL:                  moebiusgears -root                          \\n\
+-         GL:                  lockward -root                              \\n\
+-         GL:                  cubicgrid -root                             \\n\
+-         GL:                  hypnowheel -root                            \\n\
+-         GL:  \"Hypnowheel (dense)\"  hypnowheel -root -count 3 -layers 50 \\n\
+-         GL:  \"Hypnowheel (trifoil)\"        hypnowheel -root -count 3 -layers 2 -speed 9 -twist 9 -wander \\n\
                                                                              \
 -                              xdaliclock -root -font BUILTIN3             \\n\
 -                              xplanet -vroot -wait 1 -timewarp 90000        \
 "*Dialog.borderWidth:          1",
 "*Dialog.shadowThickness:      2",
 "*passwd.heading.label:                XScreenSaver %s",
-"*passwd.body.label:           This screen is locked.",
+"*passwd.body.label:           Please enter your password.",
 "*passwd.unlock.label:         OK",
 "*passwd.login.label:          New Login",
 "*passwd.user.label:           Username:",
+"*passwd.passwd.label:         Password:",
 "*passwd.thermometer.width:    8",
 "*passwd.asterisks:              True",
 "*passwd.uname:                  True",
index d1eb3c8..9ab83cb 100644 (file)
@@ -272,6 +272,9 @@ void settings_switch_page_cb (GtkNotebook *, GtkNotebookPage *,
 void settings_cancel_cb (GtkButton *, gpointer user_data);
 void settings_ok_cb (GtkButton *, gpointer user_data);
 
+static void kill_gnome_screensaver (void);
+static void kill_kde_screensaver (void);
+
 \f
 /* Some random utility functions
  */
@@ -482,9 +485,23 @@ static void warning_dialog_restart_cb (GtkWidget *widget, gpointer user_data)
   warning_dialog_dismiss_cb (widget, user_data);
 }
 
+static void warning_dialog_killg_cb (GtkWidget *widget, gpointer user_data)
+{
+  kill_gnome_screensaver ();
+  warning_dialog_dismiss_cb (widget, user_data);
+}
+
+static void warning_dialog_killk_cb (GtkWidget *widget, gpointer user_data)
+{
+  kill_kde_screensaver ();
+  warning_dialog_dismiss_cb (widget, user_data);
+}
+
+typedef enum { D_NONE, D_LAUNCH, D_GNOME, D_KDE } dialog_button;
+
 static void
 warning_dialog (GtkWidget *parent, const char *message,
-                Boolean restart_button_p, int center)
+                dialog_button button_type, int center)
 {
   char *msg = strdup (message);
   char *head;
@@ -557,7 +574,7 @@ warning_dialog (GtkWidget *parent, const char *message,
                       label, TRUE, TRUE, 0);
 
 #ifdef HAVE_GTK2
-  if (restart_button_p)
+  if (button_type != D_NONE)
     {
       cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
       gtk_container_add (GTK_CONTAINER (label), cancel);
@@ -571,7 +588,7 @@ warning_dialog (GtkWidget *parent, const char *message,
   ok = gtk_button_new_with_label ("OK");
   gtk_container_add (GTK_CONTAINER (label), ok);
 
-  if (restart_button_p)
+  if (button_type != D_NONE)
     {
       cancel = gtk_button_new_with_label ("Cancel");
       gtk_container_add (GTK_CONTAINER (label), cancel);
@@ -582,22 +599,28 @@ warning_dialog (GtkWidget *parent, const char *message,
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
   gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
   gtk_window_set_title (GTK_WINDOW (dialog), progclass);
-  STFU GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
+  GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
   gtk_widget_show (ok);
   gtk_widget_grab_focus (ok);
 
   if (cancel)
     {
-      STFU GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT); 
+      GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT); 
       gtk_widget_show (cancel);
     }
   gtk_widget_show (label);
   gtk_widget_show (dialog);
 
-  if (restart_button_p)
+  if (button_type != D_NONE)
     {
-      gtk_signal_connect_object (GTK_OBJECT (ok), "clicked",
-                                 GTK_SIGNAL_FUNC (warning_dialog_restart_cb),
+      GtkSignalFunc fn;
+      switch (button_type) {
+      case D_LAUNCH: fn = GTK_SIGNAL_FUNC (warning_dialog_restart_cb); break;
+      case D_GNOME:  fn = GTK_SIGNAL_FUNC (warning_dialog_killg_cb);   break;
+      case D_KDE:    fn = GTK_SIGNAL_FUNC (warning_dialog_killk_cb);   break;
+      default: abort(); break;
+      }
+      gtk_signal_connect_object (GTK_OBJECT (ok), "clicked", fn, 
                                  (gpointer) dialog);
       gtk_signal_connect_object (GTK_OBJECT (cancel), "clicked",
                                  GTK_SIGNAL_FUNC (warning_dialog_dismiss_cb),
@@ -644,7 +667,7 @@ run_cmd (state *s, Atom command, int arg)
         sprintf (buf, "Error:\n\n%s", err);
       else
         strcpy (buf, "Unknown error!");
-      warning_dialog (s->toplevel_widget, buf, False, 100);
+      warning_dialog (s->toplevel_widget, buf, D_NONE, 100);
     }
   if (err) free (err);
 
@@ -685,7 +708,7 @@ run_hack (state *s, int list_elt, Bool report_errors_p)
                 sprintf (buf, "Error:\n\n%s", err);
               else
                 strcpy (buf, "Unknown error!");
-              warning_dialog (s->toplevel_widget, buf, False, 100);
+              warning_dialog (s->toplevel_widget, buf, D_NONE, 100);
             }
         }
       else
@@ -700,7 +723,7 @@ run_hack (state *s, int list_elt, Bool report_errors_p)
                      "The XScreenSaver daemon doesn't seem to be running\n"
                      "on display \"%s\".  Launch it now?"),
                    d);
-          warning_dialog (s->toplevel_widget, msg, True, 1);
+          warning_dialog (s->toplevel_widget, msg, D_LAUNCH, 1);
         }
     }
 
@@ -875,7 +898,7 @@ doc_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
     {
       warning_dialog (s->toplevel_widget,
                       _("Error:\n\n"
-                       "No Help URL has been specified.\n"), False, 100);
+                       "No Help URL has been specified.\n"), D_NONE, 100);
       return;
     }
 
@@ -1001,7 +1024,7 @@ await_xscreensaver (state *s)
       else
         strcat (buf, _("Please check your $PATH and permissions."));
 
-      warning_dialog (s->toplevel_widget, buf, False, 1);
+      warning_dialog (s->toplevel_widget, buf, D_NONE, 1);
     }
 
   force_dialog_repaint (s);
@@ -1038,12 +1061,12 @@ demo_write_init_file (state *s, saver_preferences *p)
       if (!f || !*f)
         warning_dialog (s->toplevel_widget,
                         _("Error:\n\nCouldn't determine init file name!\n"),
-                        False, 100);
+                        D_NONE, 100);
       else
         {
           char *b = (char *) malloc (strlen(f) + 1024);
           sprintf (b, _("Error:\n\nCouldn't write %s\n"), f);
-          warning_dialog (s->toplevel_widget, b, False, 100);
+          warning_dialog (s->toplevel_widget, b, D_NONE, 100);
           free (b);
         }
       return -1;
@@ -1106,7 +1129,7 @@ manual_cb (GtkButton *button, gpointer user_data)
     {
       warning_dialog (GTK_WIDGET (button),
                       _("Error:\n\nno `manualCommand' resource set."),
-                      False, 100);
+                      D_NONE, 100);
     }
 
   free (oname);
@@ -1291,7 +1314,7 @@ hack_time_text (state *s, const char *line, Time *store, Bool sec_p)
                   _("Error:\n\n"
                     "Unparsable time format: \"%s\"\n"),
                   line);
-         warning_dialog (s->toplevel_widget, b, False, 100);
+         warning_dialog (s->toplevel_widget, b, D_NONE, 100);
        }
       else
        *store = value;
@@ -1537,7 +1560,7 @@ flush_dialog_changes_and_save (state *s)
       char b[255];
       sprintf (b, "Error:\n\n" "Directory does not exist: \"%s\"\n",
                p2->image_directory);
-      warning_dialog (s->toplevel_widget, b, False, 100);
+      warning_dialog (s->toplevel_widget, b, D_NONE, 100);
     }
 
 
@@ -1808,7 +1831,7 @@ list_activated_cb (GtkTreeView       *list,
   char *str;
   int list_elt;
 
-  STFU g_return_if_fail (!gdk_pointer_is_grabbed ());
+  g_return_if_fail (!gdk_pointer_is_grabbed ());
 
   str = gtk_tree_path_to_string (path);
   list_elt = strtol (str, NULL, 10);
@@ -1996,7 +2019,7 @@ store_image_directory (GtkWidget *button, gpointer user_data)
     {
       char b[255];
       sprintf (b, _("Error:\n\n" "Directory does not exist: \"%s\"\n"), path);
-      warning_dialog (GTK_WIDGET (top), b, False, 100);
+      warning_dialog (GTK_WIDGET (top), b, D_NONE, 100);
       return;
     }
 
@@ -2026,7 +2049,7 @@ store_text_file (GtkWidget *button, gpointer user_data)
     {
       char b[255];
       sprintf (b, _("Error:\n\n" "File does not exist: \"%s\"\n"), path);
-      warning_dialog (GTK_WIDGET (top), b, False, 100);
+      warning_dialog (GTK_WIDGET (top), b, D_NONE, 100);
       return;
     }
 
@@ -2057,7 +2080,7 @@ store_text_program (GtkWidget *button, gpointer user_data)
     {
       char b[255];
       sprintf (b, _("Error:\n\n" "File does not exist: \"%s\"\n"), path);
-      warning_dialog (GTK_WIDGET (top), b, False, 100);
+      warning_dialog (GTK_WIDGET (top), b, D_NONE, 100);
       return;
     }
 # endif
@@ -3414,7 +3437,7 @@ maybe_reload_init_file (state *s)
                _("Warning:\n\n"
                 "file \"%s\" has changed, reloading.\n"),
                f);
-      warning_dialog (s->toplevel_widget, b, False, 100);
+      warning_dialog (s->toplevel_widget, b, D_NONE, 100);
       free (b);
 
       load_init_file (dpy, p);
@@ -4247,6 +4270,77 @@ mapper (XrmDatabase *db, XrmBindingList bindings, XrmQuarkList quarks,
 #endif
 
 
+static Window
+gnome_screensaver_window (Screen *screen)
+{
+  Display *dpy = DisplayOfScreen (screen);
+  Window root = RootWindowOfScreen (screen);
+  Window parent, *kids;
+  unsigned int nkids;
+  Window gnome_window = 0;
+  int i;
+
+  if (! XQueryTree (dpy, root, &root, &parent, &kids, &nkids))
+    abort ();
+  for (i = 0; i < nkids; i++)
+    {
+      Atom type;
+      int format;
+      unsigned long nitems, bytesafter;
+      unsigned char *name;
+      if (XGetWindowProperty (dpy, kids[i], XA_WM_COMMAND, 0, 128,
+                              False, XA_STRING, &type, &format, &nitems,
+                              &bytesafter, &name)
+          == Success
+          && type != None
+          && !strcmp ((char *) name, "gnome-screensaver"))
+       {
+         gnome_window = kids[i];
+          break;
+       }
+    }
+
+  if (kids) XFree ((char *) kids);
+  return gnome_window;
+}
+
+static Bool
+gnome_screensaver_active_p (void)
+{
+  Display *dpy = GDK_DISPLAY();
+  Window w = gnome_screensaver_window (DefaultScreenOfDisplay (dpy));
+  return (w ? True : False);
+}
+
+static void
+kill_gnome_screensaver (void)
+{
+  Display *dpy = GDK_DISPLAY();
+  Window w = gnome_screensaver_window (DefaultScreenOfDisplay (dpy));
+  if (w) XKillClient (dpy, (XID) w);
+}
+
+static Bool
+kde_screensaver_active_p (void)
+{
+  FILE *p = popen ("dcop kdesktop KScreensaverIface isEnabled 2>/dev/null",
+                   "r");
+  char buf[255];
+  fgets (buf, sizeof(buf)-1, p);
+  pclose (p);
+  if (!strcmp (buf, "true\n"))
+    return True;
+  else
+    return False;
+}
+
+static void
+kill_kde_screensaver (void)
+{
+  system ("dcop kdesktop KScreensaverIface enable false");
+}
+
+
 static void
 the_network_is_not_the_computer (state *s)
 {
@@ -4360,12 +4454,36 @@ the_network_is_not_the_computer (state *s)
 
 
   if (*msg)
-    warning_dialog (s->toplevel_widget, msg, True, 1);
+    warning_dialog (s->toplevel_widget, msg, D_LAUNCH, 1);
 
   if (rversion) free (rversion);
   if (ruser) free (ruser);
   if (rhost) free (rhost);
   free (msg);
+  msg = 0;
+
+  /* Note: since these dialogs are not modal, they will stack up.
+     So we do this check *after* popping up the "xscreensaver is not
+     running" dialog so that these are on top.  Good enough.
+   */
+
+  if (gnome_screensaver_active_p ())
+    warning_dialog (s->toplevel_widget,
+                    _("Warning:\n\n"
+                      "The GNOME screensaver daemon appears to be running.\n"
+                      "It must be stopped for XScreenSaver to work properly.\n"
+                      "\n"
+                      "Stop the GNOME screen saver daemon now?\n"),
+                    D_GNOME, 1);
+
+  if (kde_screensaver_active_p ())
+    warning_dialog (s->toplevel_widget,
+                    _("Warning:\n\n"
+                      "The KDE screen saver daemon appears to be running.\n"
+                      "It must be stopped for XScreenSaver to work properly.\n"
+                      "\n"
+                      "Stop the KDE screen saver daemon now?\n"),
+                    D_KDE, 1);
 }
 
 
index 0f2aaa2..5da53a0 100644 (file)
@@ -1,5 +1,5 @@
 /* exec.c --- executes a program in *this* pid, without an intervening process.
- * xscreensaver, Copyright (c) 1991-2006 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -181,8 +181,7 @@ exec_command (const char *shell, const char *command, int nice_level)
   int hairy_p;
 
 #ifndef VMS
-  if (nice != 0)
-    nice_process (nice_level);
+  nice_process (nice_level);
 
   hairy_p = !!strpbrk (command, "*?$&!<>[];`'\\\"=");
   /* note: = is in the above because of the sh syntax "FOO=bar cmd". */
index e1d29dc..47c002d 100644 (file)
@@ -1,5 +1,5 @@
 /* lock.c --- handling the password dialog for locking-mode.
- * xscreensaver, Copyright (c) 1993-2007 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -179,7 +179,7 @@ static void restore_background (saver_info *si);
 
 extern void xss_authenticate(saver_info *si, Bool verbose_p);
 
-static void
+static int
 new_passwd_window (saver_info *si)
 {
   passwd_dialog_data *pw;
@@ -190,7 +190,7 @@ new_passwd_window (saver_info *si)
 
   pw = (passwd_dialog_data *) calloc (1, sizeof(*pw));
   if (!pw)
-    return;
+    return -1;
 
   /* Display the button only if the "newLoginCommand" pref is non-null.
    */
@@ -406,13 +406,14 @@ new_passwd_window (saver_info *si)
   }
 
   si->pw_data = pw;
+  return 0;
 }
 
 
 /**
  * info_msg and prompt may be NULL.
  */
-static void
+static int
 make_passwd_window (saver_info *si,
                    const char *info_msg,
                    const char *prompt,
@@ -428,11 +429,15 @@ make_passwd_window (saver_info *si,
 
   cleanup_passwd_window (si);
 
+  if (! ssi)   /* WTF?  Trying to prompt while no screens connected? */
+    return -1;
+
   if (!si->pw_data)
-    new_passwd_window (si);
+    if (new_passwd_window (si) < 0)
+      return -1;
 
   if (!(pw = si->pw_data))
-    return;
+    return -1;
 
   pw->ratio = 1.0;
 
@@ -614,10 +619,11 @@ make_passwd_window (saver_info *si,
      actually be visible; this takes into account virtual viewports as
      well as Xinerama. */
   {
-    int x, y, w, h;
-    get_screen_viewport (pw->prompt_screen, &x, &y, &w, &h,
-                         pw->previous_mouse_x, pw->previous_mouse_y,
-                         si->prefs.verbose_p);
+    saver_screen_info *ssi = &si->screens [mouse_screen (si)];
+    int x = ssi->x;
+    int y = ssi->y;
+    int w = ssi->width;
+    int h = ssi->height;
     if (si->prefs.debug_p) w /= 2;
     pw->x = x + ((w + pw->width) / 2) - pw->width;
     pw->y = y + ((h + pw->height) / 2) - pw->height;
@@ -678,6 +684,8 @@ make_passwd_window (saver_info *si,
   if (cmap)
     XInstallColormap (si->dpy, cmap);
   draw_passwd_window (si);
+
+  return 0;
 }
 
 
@@ -1463,6 +1471,7 @@ xfree_lock_mode_switch (saver_info *si, Bool lock_p)
   static Bool any_mode_locked_p = False;
   saver_preferences *p = &si->prefs;
   int screen;
+  int real_nscreens = ScreenCount (si->dpy);
   int event, error;
   Bool status;
   XErrorHandler old_handler;
@@ -1472,7 +1481,7 @@ xfree_lock_mode_switch (saver_info *si, Bool lock_p)
   if (!XF86VidModeQueryExtension (si->dpy, &event, &error))
     return;
 
-  for (screen = 0; screen < (si->xinerama_p ? 1 : si->nscreens); screen++)
+  for (screen = 0; screen < real_nscreens; screen++)
     {
       XSync (si->dpy, False);
       old_handler = XSetErrorHandler (ignore_all_errors_ehandler);
@@ -1509,12 +1518,13 @@ undo_vp_motion (saver_info *si)
 #ifdef HAVE_XF86VMODE
   saver_preferences *p = &si->prefs;
   int screen;
+  int real_nscreens = ScreenCount (si->dpy);
   int event, error;
 
   if (!XF86VidModeQueryExtension (si->dpy, &event, &error))
     return;
 
-  for (screen = 0; screen < si->nscreens; screen++)
+  for (screen = 0; screen < real_nscreens; screen++)
     {
       saver_screen_info *ssi = &si->screens[screen];
       int x, y;
@@ -1932,9 +1942,11 @@ gui_auth_conv(int num_msg,
        info_msg_trimmed = remove_trailing_whitespace(info_msg);
        prompt_trimmed = remove_trailing_whitespace(prompt);
 
-       make_passwd_window(si, info_msg_trimmed, prompt_trimmed,
-                          auth_msgs[i].type == AUTH_MSGTYPE_PROMPT_ECHO
-                          ? True : False);
+       if (make_passwd_window(si, info_msg_trimmed, prompt_trimmed,
+                               auth_msgs[i].type == AUTH_MSGTYPE_PROMPT_ECHO
+                               ? True : False)
+            < 0)
+          goto fail;
 
        if (info_msg_trimmed)
          free(info_msg_trimmed);
index d6df844..1bc3cf0 100644 (file)
@@ -153,6 +153,8 @@ mlstring_wrap(mlstring *mstring, XFontStruct *font, Dimension width)
          
          if (wrap_at == -1) /* No space found, hard wrap */
            wrap_at = line_length;
+         else
+            wrap_at++; /* Leave space at the end of the line */
 
          newml = calloc(1, sizeof(*newml));
          if (!newml) /* OOM, don't bother trying to wrap */
index bb8d992..202e0eb 100644 (file)
  static const char *tk_file;
 #endif /* !HAVE_DARWIN */
 
+/* warning suppression: duplicated in passwd.c */
+extern Bool kerberos_lock_init (int argc, char **argv, Bool verbose_p);
+extern Bool kerberos_passwd_valid_p (const char *typed_passwd, Bool verbose_p);
+
 
 /* Called at startup to grab user, instance, and realm information
    from the user's ticketfile (remember, name.inst@realm). Since we're
index 334d12b..3b4c64f 100644 (file)
@@ -452,6 +452,14 @@ pam_conversation (int nmsgs,
 
   ret = si->unlock_cb(nmsgs, messages, &authresp, si);
 
+  /* #### If the user times out, or hits ESC or Cancel, we return PAM_CONV_ERR,
+          and PAM logs this as an authentication failure.  It would be nice if
+          there was some way to indicate that this was a "cancel" rather than
+          a "fail", so that it wouldn't show up in syslog, but I think the
+          only options are PAM_SUCCESS and PAM_CONV_ERR.  (I think that
+          PAM_ABORT means "internal error", not "cancel".)  Bleh.
+   */
+
   if (ret == 0)
     {
       for (i = 0; i < nmsgs; ++i)
index 60778fe..166826e 100644 (file)
@@ -1,6 +1,6 @@
 /* pdf2jpeg -- converts a PDF file to a JPEG file, using Cocoa
  *
- * Copyright (c) 2003 by Jamie Zawinski <jwz@jwz.org>
+ * Copyright (c) 2003, 2008 by Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -23,6 +23,7 @@ main (int argc, char** argv)
   const char *progname = argv[0];
   const char *infile = 0, *outfile = 0;
   double compression = 0.85;
+  double scale = 1.0;
   int verbose = 0;
   int i;
 
@@ -45,6 +46,18 @@ main (int argc, char** argv)
             }
           compression = q / 100.0;
         }
+      else if (!strcmp (argv[i], "-scale"))
+        {
+          float s;
+          if (1 != sscanf (argv[++i], " %f %c", &s, &c) ||
+              s <= 0 || s > 50)
+            {
+              fprintf (stderr, "%s: scale must be 0.0 - 50.0 (%f)\n",
+                       progname, s);
+              goto USAGE;
+            }
+          scale = s;
+        }
       else if (!strcmp (argv[i], "-verbose"))
         verbose++;
       else if (!strcmp (argv[i], "-v") ||
@@ -64,7 +77,7 @@ main (int argc, char** argv)
         {
         USAGE:
           fprintf (stderr,
-                   "usage: %s [-verbose] [-quality NN] "
+                   "usage: %s [-verbose] [-scale N] [-quality NN] "
                    "infile.pdf outfile.jpg\n",
                    progname);
           exit (1);
@@ -93,11 +106,16 @@ main (int argc, char** argv)
   NSPDFImageRep *pdf_rep = [NSPDFImageRep imageRepWithData:pdf_data];
 
   // Create an NSImage instance
-  NSImage *image = [[NSImage alloc] initWithSize:[pdf_rep size]];
+  NSRect rect;
+  rect.size = [pdf_rep size];
+  rect.size.width  *= scale;
+  rect.size.height *= scale;
+  rect.origin.x = rect.origin.y = 0;
+  NSImage *image = [[NSImage alloc] initWithSize:rect.size];
 
   // Draw the PDFImageRep in the NSImage
   [image lockFocus];
-  [pdf_rep drawAtPoint:NSMakePoint(0.0,0.0)];
+  [pdf_rep drawInRect:rect];
   [image unlockFocus];
 
   // Load the NSImage's contents into an NSBitmapImageRep:
index c8e4ae1..1b09314 100644 (file)
@@ -1,5 +1,5 @@
 /* dotfile.c --- management of the ~/.xscreensaver file.
- * xscreensaver, Copyright (c) 1998-2006 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1998-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -272,6 +272,7 @@ static const char * const prefs[] = {
   "fadeTicks",
   "captureStderr",
   "captureStdout",             /* not saved -- obsolete */
+  "logFile",                   /* not saved */
   "ignoreUninstalledPrograms",
   "font",
   "dpmsEnabled",
@@ -808,6 +809,7 @@ write_init_file (Display *dpy,
       CHECK("fadeTicks")       type = pref_int,  i = p->fade_ticks;
       CHECK("captureStderr")   type = pref_bool, b = p->capture_stderr_p;
       CHECK("captureStdout")   continue;  /* don't save */
+      CHECK("logFile")         continue;  /* don't save */
       CHECK("ignoreUninstalledPrograms")
                                 type = pref_bool, b = p->ignore_uninstalled_p;
 
index ff745eb..a85a274 100644 (file)
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Exec=xscreensaver-demo
-Icon=xscreensaver
+Icon=xscreensaver.svg
 Terminal=false
 _Name=Screensaver
 _Comment=Change screensaver properties
index 56f66da..491ebe8 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-2006 Jamie Zawinski <jwz@netscape.com>
+/* xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@netscape.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -170,6 +170,10 @@ make_splash_dialog (saver_info *si)
     return;
 
   ssi = &si->screens[mouse_screen (si)];
+
+  if (!ssi || !ssi->screen)
+    return;    /* WTF?  Trying to splash while no screens connected? */
+
   cmap = DefaultColormapOfScreen (ssi->screen);
 
   sp = (splash_dialog_data *) calloc (1, sizeof(*sp));
@@ -376,7 +380,7 @@ make_splash_dialog (saver_info *si)
   attrs.event_mask = (ExposureMask | ButtonPressMask | ButtonReleaseMask);
 
   {
-    int sx, sy, w, h;
+    int sx = 0, sy = 0, w, h;
     int mouse_x = 0, mouse_y = 0;
 
     {
@@ -393,7 +397,10 @@ make_splash_dialog (saver_info *si)
         }
     }
 
-    get_screen_viewport (ssi, &sx, &sy, &w, &h, mouse_x, mouse_y, False);
+    x = ssi->x;
+    y = ssi->y;
+    w = ssi->width;
+    h = ssi->height;
     if (si->prefs.debug_p) w /= 2;
     x = sx + (((w + sp->width)  / 2) - sp->width);
     y = sy + (((h + sp->height) / 2) - sp->height);
index 6246dd3..68e7521 100644 (file)
@@ -1,5 +1,5 @@
 /* stderr.c --- capturing stdout/stderr output onto the screensaver window.
- * xscreensaver, Copyright (c) 1991-2006 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -472,6 +472,47 @@ initialize_stderr (saver_info *si)
 }
 
 
+/* If the "-log file" command-line option has been specified,
+   open the file for append, and redirect stdout/stderr there.
+   This is called very early, before initialize_stderr().
+ */
+void
+stderr_log_file (saver_info *si)
+{
+  int stdout_fd = 1;
+  int stderr_fd = 2;
+  const char *filename = get_string_resource (si->dpy, "logFile", "LogFile");
+  int fd;
+
+  if (!filename || !*filename) return;
+
+  fd = open (filename, O_WRONLY | O_APPEND | O_CREAT, 0666);
+
+  if (fd < 0)
+    {
+      char buf[255];
+    FAIL:
+      sprintf (buf, "%.100s: %.100s", blurb(), filename);
+      perror (buf);
+      fflush (stderr);
+      fflush (stdout);
+      exit (1);
+    }
+
+  fprintf (stderr, "%s: logging to file %s\n", blurb(), filename);
+
+  if (dup2 (fd, stdout_fd) < 0) goto FAIL;
+  if (dup2 (fd, stderr_fd) < 0) goto FAIL;
+
+  fprintf (stderr, "\n\n"
+ "##########################################################################\n"
+           "%s: logging to \"%s\" at %s\n"
+ "##########################################################################\n"
+           "\n",
+           blurb(), filename, timestring());
+}
+
+
 /* If there is anything in the stderr buffer, flush it to the real stderr.
    This does no X operations.  Call this when exiting to make sure any
    last words actually show up.
@@ -487,8 +528,7 @@ shutdown_stderr (saver_info *si)
 
   stderr_callback ((XtPointer) si, &stderr_stdout_read_fd, 0);
 
-  if (stderr_buffer &&
-      stderr_tail &&
+  if (stderr_tail &&
       stderr_buffer < stderr_tail)
     {
       *stderr_tail = 0;
index 88270d6..405a382 100644 (file)
@@ -851,7 +851,7 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
     case 0:
       close (ConnectionNumber (si->dpy));      /* close display fd */
       limit_subproc_memory (p->inferior_memory_limit, p->verbose_p);
-      hack_subproc_environment (ssi);          /* set $DISPLAY */
+      hack_subproc_environment (ssi->screen, ssi->screensaver_window);
 
       if (p->verbose_p)
         fprintf (stderr, "%s: %d: spawning \"%s\" in pid %lu.\n",
@@ -878,14 +878,22 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
 }
 
 
-static void
-spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p)
+void
+spawn_screenhack (saver_screen_info *ssi)
 {
   saver_info *si = ssi->global;
   saver_preferences *p = &si->prefs;
-  raise_window (si, first_time_p, True, False);
   XFlush (si->dpy);
 
+  if (!monitor_powered_on_p (si))
+    {
+      if (si->prefs.verbose_p)
+        fprintf (stderr,
+                 "%s: %d: X says monitor has powered down; "
+                 "not launching a hack.\n", blurb(), ssi->number);
+      return;
+    }
+
   if (p->screenhacks_count)
     {
       screenhack *hack;
@@ -1017,55 +1025,28 @@ spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p)
          break;
        }
     }
-}
-
-
-void
-spawn_screenhack (saver_info *si, Bool first_time_p)
-{
-  if (monitor_powered_on_p (si))
-    {
-      int i;
-      for (i = 0; i < si->nscreens; i++)
-        {
-          saver_screen_info *ssi = &si->screens[i];
-          spawn_screenhack_1 (ssi, first_time_p);
-        }
-    }
-  else if (si->prefs.verbose_p)
-    fprintf (stderr,
-             "%s: X says monitor has powered down; "
-             "not launching a hack.\n", blurb());
 
-  store_saver_status (si);  /* store current hack numbers */
+  store_saver_status (si);  /* store current hack number */
 }
 
 
 void
-kill_screenhack (saver_info *si)
+kill_screenhack (saver_screen_info *ssi)
 {
-  int i;
-  for (i = 0; i < si->nscreens; i++)
-    {
-      saver_screen_info *ssi = &si->screens[i];
-      if (ssi->pid)
-       kill_job (si, ssi->pid, SIGTERM);
-      ssi->pid = 0;
-    }
+  saver_info *si = ssi->global;
+  if (ssi->pid)
+    kill_job (si, ssi->pid, SIGTERM);
+  ssi->pid = 0;
 }
 
 
 void
-suspend_screenhack (saver_info *si, Bool suspend_p)
+suspend_screenhack (saver_screen_info *ssi, Bool suspend_p)
 {
 #ifdef SIGSTOP /* older VMS doesn't have it... */
-  int i;
-  for (i = 0; i < si->nscreens; i++)
-    {
-      saver_screen_info *ssi = &si->screens[i];
-      if (ssi->pid)
-       kill_job (si, ssi->pid, (suspend_p ? SIGSTOP : SIGCONT));
-    }
+  saver_info *si = ssi->global;
+  if (ssi->pid)
+    kill_job (si, ssi->pid, (suspend_p ? SIGSTOP : SIGCONT));
 #endif /* SIGSTOP */
 }
 
@@ -1137,7 +1118,7 @@ hack_environment (saver_info *si)
 
 
 void
-hack_subproc_environment (saver_screen_info *ssi)
+hack_subproc_environment (Screen *screen, Window saver_window)
 {
   /* Store $DISPLAY into the environment, so that the $DISPLAY variable that
      the spawned processes inherit is correct.  First, it must be on the same
@@ -1152,8 +1133,8 @@ hack_subproc_environment (saver_screen_info *ssi)
      us to (eventually) run multiple hacks in Xinerama mode, where each hack
      has the same $DISPLAY but a different piece of glass.
    */
-  saver_info *si = ssi->global;
-  const char *odpy = DisplayString (si->dpy);
+  Display *dpy = DisplayOfScreen (screen);
+  const char *odpy = DisplayString (dpy);
   char *ndpy = (char *) malloc (strlen(odpy) + 20);
   char *nssw = (char *) malloc (40);
   char *s, *c;
@@ -1170,10 +1151,9 @@ hack_subproc_environment (saver_screen_info *ssi)
   while (isdigit(*s)) s++;                     /* skip over dpy number */
   while (*s == '.') s++;                       /* skip over dot */
   if (s[-1] != '.') *s++ = '.';                        /* put on a dot */
-  sprintf(s, "%d", ssi->real_screen_number);   /* put on screen number */
+  sprintf(s, "%d", screen_number (screen));    /* put on screen number */
 
-  sprintf (nssw, "XSCREENSAVER_WINDOW=0x%lX",
-           (unsigned long) ssi->screensaver_window);
+  sprintf (nssw, "XSCREENSAVER_WINDOW=0x%lX", (unsigned long) saver_window);
 
   /* Allegedly, BSD 4.3 didn't have putenv(), but nobody runs such systems
      any more, right?  It's not Posix, but everyone seems to have it. */
@@ -1194,9 +1174,8 @@ hack_subproc_environment (saver_screen_info *ssi)
 /* GL crap */
 
 Visual *
-get_best_gl_visual (saver_screen_info *ssi)
+get_best_gl_visual (saver_info *si, Screen *screen)
 {
-  saver_info *si = ssi->global;
   pid_t forked;
   int fds [2];
   int in, out;
@@ -1217,6 +1196,11 @@ get_best_gl_visual (saver_screen_info *ssi)
   in = fds [0];
   out = fds [1];
 
+  block_sigchld();   /* This blocks it in the parent and child, to avoid
+                        racing.  It is never unblocked in the child before
+                        the child exits, but that doesn't matter.
+                      */
+
   switch ((int) (forked = fork ()))
     {
     case -1:
@@ -1237,7 +1221,7 @@ get_best_gl_visual (saver_screen_info *ssi)
             perror ("could not dup() a new stdout:");
             return 0;
           }
-        hack_subproc_environment (ssi);                /* set $DISPLAY */
+        hack_subproc_environment (screen, 0);  /* set $DISPLAY */
 
         execvp (av[0], av);                    /* shouldn't return. */
 
@@ -1270,6 +1254,8 @@ get_best_gl_visual (saver_screen_info *ssi)
         /* Wait for the child to die. */
         waitpid (-1, &wait_status, 0);
 
+        unblock_sigchld();   /* child is dead and waited, unblock now. */
+
         if (1 == sscanf (buf, "0x%lx %c", &v, &c))
           result = (int) v;
 
@@ -1291,12 +1277,13 @@ get_best_gl_visual (saver_screen_info *ssi)
           }
         else
           {
-            Visual *v = id_to_visual (ssi->screen, result);
+            Visual *v = id_to_visual (screen, result);
             if (si->prefs.verbose_p)
               fprintf (stderr, "%s: %d: %s: GL visual is 0x%X%s.\n",
-                       blurb(), ssi->number,
+                       blurb(), screen_number (screen),
                        av[0], result,
-                       (v == ssi->default_visual ? " (default)" : ""));
+                       (v == DefaultVisualOfScreen (screen)
+                        ? " (default)" : ""));
             return v;
           }
       }
index ac5bf99..42e2e28 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1998-2007 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -65,21 +65,6 @@ const char *blurb(void) { return progname; }
 Atom XA_SCREENSAVER, XA_DEMO, XA_PREFS;
 
 void
-get_screen_viewport (saver_screen_info *ssi,
-                     int *x_ret, int *y_ret,
-                     int *w_ret, int *h_ret,
-                     int tx, int ty,
-                     Bool verbose_p)
-{
-  *x_ret = 0;
-  *y_ret = 0;
-  *w_ret = WidthOfScreen (ssi->screen);
-  *h_ret = HeightOfScreen (ssi->screen);
-
-  if (*w_ret > *h_ret * 2) *w_ret /= 2;  /* xinerama kludge */
-}
-
-void
 idle_timer (XtPointer closure, XtIntervalId *id)
 {
   saver_info *si = (saver_info *) closure;
@@ -230,8 +215,6 @@ main (int argc, char **argv)
         visual_depth(si->default_screen->screen,
                      si->default_screen->current_visual);
 
-      /* I could call get_screen_viewport(), but it is not worthwhile.
-       * These are used by the save_under pixmap. */
       ssip.width = WidthOfScreen(ssip.screen);
       ssip.height = HeightOfScreen(ssip.screen);
 
@@ -246,6 +229,9 @@ main (int argc, char **argv)
   pw = getpwuid (getuid ());
   si->user = strdup (pw->pw_name);
 
+/*  si->nscreens = 0;
+  si->screens = si->default_screen = 0; */
+
   while (1)
     {
 #ifndef NO_LOCKING
index da86e04..0d57895 100644 (file)
@@ -1,5 +1,5 @@
 /* test-randr.c --- playing with the Resize And Rotate extension.
- * xscreensaver, Copyright (c) 2004, 2005 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 2004-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -233,6 +233,43 @@ main (int argc, char **argv)
           fprintf(stderr, "%s:   XRRGetScreenInfo(dpy, %d) ==> NULL\n",
                   blurb(), i);
         }
+
+
+# ifdef HAVE_RANDR_12
+      if (major > 1 || (major == 1 && minor >= 2))
+        {
+          int j;
+          XRRScreenResources *res = 
+            XRRGetScreenResources (dpy, RootWindow (dpy, i));
+          fprintf (stderr, "\n");
+          for (j = 0; j < res->noutput; j++)
+            {
+              int k;
+              XRROutputInfo *rroi = 
+                XRRGetOutputInfo (dpy, res, res->outputs[j]);
+              fprintf (stderr, "%s:   Output %d: %s: %s (%d)\n", blurb(), j,
+                       rroi->name,
+                       (rroi->connection == RR_Disconnected ? "disconnected" :
+                        rroi->connection == RR_UnknownConnection ? "unknown" :
+                        "connected"),
+                       (int) rroi->crtc);
+              for (k = 0; k < rroi->ncrtc; k++)
+                {
+                  XRRCrtcInfo *crtci = XRRGetCrtcInfo (dpy, res, 
+                                                       rroi->crtcs[k]);
+                  fprintf(stderr, "%s:   %c CRTC %d (%d): %dx%d+%d+%d\n", 
+                          blurb(),
+                          (rroi->crtc == rroi->crtcs[k] ? '+' : ' '),
+                          k, (int) rroi->crtcs[k],
+                          crtci->width, crtci->height, crtci->x, crtci->y);
+                  XRRFreeCrtcInfo (crtci);
+                }
+              XRRFreeOutputInfo (rroi);
+              fprintf (stderr, "\n");
+            }
+          XRRFreeScreenResources (res);
+        }
+# endif /* HAVE_RANDR_12 */
     }
 
   if (major > 0)
index c743492..584a6d0 100644 (file)
@@ -264,14 +264,18 @@ cycle_timer (XtPointer closure, XtIntervalId *id)
     }
   else
     {
+      int i;
       maybe_reload_init_file (si);
-      kill_screenhack (si);
+      for (i = 0; i < si->nscreens; i++)
+        kill_screenhack (&si->screens[i]);
+
+      raise_window (si, True, True, False);
 
       if (!si->throttled_p)
-        spawn_screenhack (si, False);
+        for (i = 0; i < si->nscreens; i++)
+          spawn_screenhack (&si->screens[i]);
       else
         {
-          raise_window (si, True, True, False);
           if (p->verbose_p)
             fprintf (stderr, "%s: not launching new hack (throttled.)\n",
                      blurb());
@@ -1010,28 +1014,17 @@ sleep_until_idle (saver_info *si, Bool until_idle_p)
         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. */
-
+               size, rotation, or refresh rate of any screen has changed.
+             */
             XRRScreenChangeNotifyEvent *xrr_event =
               (XRRScreenChangeNotifyEvent *) &event;
-            /* XRRRootToScreen is in Xrandr.h 1.4, 2001/06/07 */
-            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);
+                /* XRRRootToScreen is in Xrandr.h 1.4, 2001/06/07 */
+                int screen = XRRRootToScreen (si->dpy, xrr_event->window);
+                fprintf (stderr, "%s: %d: screen change event received\n",
+                         blurb(), screen);
               }
 
 # ifdef RRScreenChangeNotifyMask
@@ -1040,7 +1033,15 @@ sleep_until_idle (saver_info *si, Bool until_idle_p)
 # endif /* RRScreenChangeNotifyMask */
 
             /* Resize the existing xscreensaver windows and cached ssi data. */
-            resize_screensaver_window (si);
+            if (update_screen_layout (si))
+              {
+                if (p->verbose_p)
+                  {
+                    fprintf (stderr, "%s: new layout:\n", blurb());
+                    describe_monitor_layout (si);
+                  }
+                resize_screensaver_window (si);
+              }
           }
         else
 #endif /* HAVE_RANDR */
@@ -1401,11 +1402,13 @@ watchdog_timer (XtPointer closure, XtIntervalId *id)
       if (screenhack_running_p (si) &&
           !monitor_powered_on_p (si))
        {
+          int i;
          if (si->prefs.verbose_p)
            fprintf (stderr,
                     "%s: X says monitor has powered down; "
                     "killing running hacks.\n", blurb());
-         kill_screenhack (si);
+          for (i = 0; i < si->nscreens; i++)
+            kill_screenhack (&si->screens[i]);
        }
 
       /* Re-schedule this timer.  The watchdog timer defaults to a bit less
index 4832187..63ac39e 100644 (file)
@@ -1,7 +1,4 @@
-/* types.h
- *
- * This file is part of XScreenSaver,
- * Copyright (c) 1993-2004 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
  * implied warranty.
  */
 
-#ifndef TYPES_H
-#define TYPES_H
+#ifndef __XSCREENSAVER_TYPES_H__
+#define __XSCREENSAVER_TYPES_H__
 
 typedef struct saver_info saver_info;
 
-/* Unlock states. Old pw_* equivalents in square brackets:
- * ul_read - reading input (or ready to do so) [pw_read]
- * ul_success - auth success, unlock the screen [pw_ok]
- * ul_fail - authentication failed [pw_fail]
- * ul_cancel - user cancelled auth [pw_cancel or pw_null]
- * ul_time - timed out, user took too long [pw_time]
- * ul_finished - user pressed enter on the current prompt, process input
- */
-enum unlock_state { ul_read, ul_success, ul_fail, ul_cancel, ul_time, ul_finished };
+typedef enum {
+  ul_read,             /* reading input or ready to do so */
+  ul_success,          /* auth success, unlock */
+  ul_fail,             /* auth fail */
+  ul_cancel,           /* user cancelled auth (pw_cancel or pw_null) */
+  ul_time,             /* timed out */
+  ul_finished          /* user pressed enter */
+} unlock_state;
 
 typedef struct screenhack screenhack;
 struct screenhack {
@@ -56,6 +52,7 @@ typedef struct saver_preferences saver_preferences;
 typedef struct saver_screen_info saver_screen_info;
 typedef struct passwd_dialog_data passwd_dialog_data;
 typedef struct splash_dialog_data splash_dialog_data;
+typedef struct _monitor monitor;
 
 
 /* This structure holds all the user-specified parameters, read from the
@@ -158,9 +155,11 @@ struct saver_info {
   saver_preferences prefs;
 
   int nscreens;
+  int ssi_count;
   saver_screen_info *screens;
   saver_screen_info *default_screen;   /* ...on which dialogs will appear. */
-
+  monitor **monitor_layout;            /* private to screens.c */
+  Visual **best_gl_visuals;            /* visuals for GL hacks on screen N */
 
   /* =======================================================================
      global connection info
@@ -173,7 +172,6 @@ struct saver_info {
      server extension info
      ======================================================================= */
 
-  Bool xinerama_p;                /* Whether Xinerama is in use.            */
   Bool using_xidle_extension;     /* which extension is being used.         */
   Bool using_mit_saver_extension;  /* Note that `p->use_*' is the *request*, */
   Bool using_sgi_saver_extension;  /* and `si->using_*' is the *reality*.    */
@@ -247,7 +245,7 @@ struct saver_info {
   char *user;                  /* The user whose session is locked. */
   char *cached_passwd;         /* Cached password, used to avoid multiple
                                   prompts for password-only auth mechanisms.*/
-  enum unlock_state unlock_state;
+  unlock_state unlock_state;
 
   auth_conv_cb_t unlock_cb;    /* The function used to prompt for creds. */
   void (*auth_finished_cb) (saver_info *si);
@@ -349,7 +347,6 @@ struct saver_screen_info {
   int current_depth;           /* How deep the visual (and the window) are. */
 
   Visual *default_visual;      /* visual to use when none other specified */
-  Visual *best_gl_visual;      /* visual to use for GL hacks */
 
   Window real_vroot;           /* The original virtual-root window. */
   Window real_vroot_value;     /* What was in the __SWM_VROOT property. */
@@ -407,4 +404,4 @@ struct saver_screen_info {
 };
 
 
-#endif
+#endif /* __XSCREENSAVER_TYPES_H__ */
index 9dbb500..44cce89 100644 (file)
@@ -226,6 +226,14 @@ nuke_focus (saver_info *si, int screen_no)
 }
 
 
+static void
+ungrab_keyboard_and_mouse (saver_info *si)
+{
+  ungrab_mouse (si);
+  ungrab_kbd (si);
+}
+
+
 static Bool
 grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor,
                          int screen_no)
@@ -291,18 +299,15 @@ grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor,
    */
 
   if (kstatus != GrabSuccess)  /* Do not blank without a kbd grab.   */
-    return False;
+    {
+      /* If we didn't get both grabs, release the one we did get. */
+      ungrab_keyboard_and_mouse (si);
+      return False;
+    }
 
   return True;                 /* Grab is good, go ahead and blank.  */
 }
 
-static void
-ungrab_keyboard_and_mouse (saver_info *si)
-{
-  ungrab_mouse (si);
-  ungrab_kbd (si);
-}
-
 
 int
 move_mouse_grab (saver_info *si, Window to, Cursor cursor, int to_screen_no)
@@ -393,6 +398,21 @@ ensure_no_screensaver_running (Display *dpy, Screen *screen)
                    (char *) id);
          status = True;
        }
+
+      else if (XGetWindowProperty (dpy, kids[i], XA_WM_COMMAND, 0, 128,
+                                   False, XA_STRING, &type, &format, &nitems,
+                                   &bytesafter, &version)
+               == Success
+               && type != None
+               && !strcmp ((char *) version, "gnome-screensaver"))
+       {
+         fprintf (stderr,
+                 "%s: \"%s\" is already running on display %s (window 0x%x)\n",
+                  blurb(), (char *) version,
+                   DisplayString (dpy), (int) kids [i]);
+         status = True;
+          break;
+       }
     }
 
   if (kids) XFree ((char *) kids);
@@ -445,11 +465,6 @@ remove_vroot_property (Display *dpy, Window win)
 
 static Bool safe_XKillClient (Display *dpy, XID id);
 
-#ifdef HAVE_XF86VMODE
-static Bool safe_XF86VidModeGetViewPort (Display *, int, int *, int *);
-#endif /* HAVE_XF86VMODE */
-
-
 static void
 kill_xsetroot_data_1 (Display *dpy, Window window,
                       Atom prop, const char *atom_name,
@@ -607,7 +622,8 @@ restore_real_vroot_1 (saver_screen_info *ssi)
     fprintf (stderr,
             "%s: restoring __SWM_VROOT property on the real vroot (0x%lx).\n",
             blurb(), (unsigned long) ssi->real_vroot);
-  remove_vroot_property (si->dpy, ssi->screensaver_window);
+  if (ssi->screensaver_window)
+    remove_vroot_property (si->dpy, ssi->screensaver_window);
   if (ssi->real_vroot)
     {
       store_vroot_property (si->dpy, ssi->real_vroot, ssi->real_vroot_value);
@@ -812,8 +828,10 @@ saver_sighup_handler (int sig)
 
   if (si->screen_blanked_p)
     {
+      int i;
+      for (i = 0; i < si->nscreens; i++)
+        kill_screenhack (&si->screens[i]);
       unblank_screen (si);
-      kill_screenhack (si);
       XSync (si->dpy, False);
     }
 
@@ -999,232 +1017,6 @@ store_saver_status (saver_info *si)
 }
 
 
-
-/* Returns the area of the screen which the xscreensaver window should cover.
-   Normally this is the whole screen, but if the X server's root window is
-   actually larger than the monitor's displayable area, then we want to
-   operate in the currently-visible portion of the desktop instead.
- */
-void
-get_screen_viewport (saver_screen_info *ssi,
-                     int *x_ret, int *y_ret,
-                     int *w_ret, int *h_ret,
-                     int target_x, int target_y,
-                     Bool verbose_p)
-{
-  int w = WidthOfScreen (ssi->screen);
-  int h = HeightOfScreen (ssi->screen);
-
-# 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
-  /* 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 */
-
-#  ifdef HAVE_XINERAMA
-  if (xinerama_p)
-    {
-      int mouse_p = (target_x != -1 && target_y != -1);
-      int which = -1;
-      int i;
-
-      /* If a mouse position wasn't passed in, assume we're talking about
-         this screen. */
-      if (!mouse_p)
-        {
-          target_x = ssi->x;
-          target_y = ssi->y;
-          which = ssi->number;
-        }
-
-      /* Find the Xinerama rectangle that contains the mouse position. */
-      for (i = 0; i < si->nscreens; i++)
-        {
-          if (which == -1 &&
-              target_x >= si->screens[i].x &&
-              target_y >= si->screens[i].y &&
-              target_x <  si->screens[i].x + si->screens[i].width &&
-              target_y <  si->screens[i].y + si->screens[i].height)
-            which = i;
-        }
-      if (which == -1) which = 0;  /* didn't find it?  Use the first. */
-      *x_ret = si->screens[which].x;
-      *y_ret = si->screens[which].y;
-      *w_ret = si->screens[which].width;
-      *h_ret = si->screens[which].height;
-
-      if (verbose_p)
-        {
-          fprintf (stderr, "%s: %d: xinerama vp: %dx%d+%d+%d",
-                   blurb(), which,
-                   si->screens[which].width, si->screens[which].height,
-                   si->screens[which].x, si->screens[which].y);
-          if (mouse_p)
-            fprintf (stderr, "; mouse at %d,%d", target_x, target_y);
-          fprintf (stderr, ".\n");
-        }
-
-      return;
-    }
-#  endif /* HAVE_XINERAMA */
-
-  if (!xinerama_p &&  /* Xinerama + VidMode = broken. */
-      XF86VidModeQueryExtension (si->dpy, &event, &error) &&
-      safe_XF86VidModeGetViewPort (si->dpy, ssi->number, &x, &y) &&
-      XF86VidModeGetModeLine (si->dpy, ssi->number, &dot, &ml))
-    {
-      char msg[512];
-      *x_ret = x;
-      *y_ret = y;
-      *w_ret = ml.hdisplay;
-      *h_ret = ml.vdisplay;
-
-      if (*x_ret == 0 && *y_ret == 0 && *w_ret == w && *h_ret == h)
-        /* There is no viewport -- the screen does not scroll. */
-        return;
-
-
-      /* Apparently some versions of XFree86 return nonsense here!
-         I've had reports of 1024x768 viewports at -1936862040, -1953705044.
-         So, sanity-check the values and give up if they are out of range.
-       */
-      if (*x_ret <  0 || *x_ret >= w ||
-          *y_ret <  0 || *y_ret >= h ||
-          *w_ret <= 0 || *w_ret >  w ||
-          *h_ret <= 0 || *h_ret >  h)
-        {
-          static int warned_once = 0;
-          if (!warned_once)
-            {
-              fprintf (stderr, "\n"
-                  "%s: X SERVER BUG: %dx%d viewport at %d,%d is impossible.\n"
-                  "%s: The XVidMode server extension is returning nonsense.\n"
-                  "%s: Please report this bug to your X server vendor.\n\n",
-                       blurb(), *w_ret, *h_ret, *x_ret, *y_ret,
-                       blurb(), blurb());
-              warned_once = 1;
-            }
-          *x_ret = 0;
-          *y_ret = 0;
-          *w_ret = w;
-          *h_ret = h;
-          return;
-        }
-
-      sprintf (msg, "%s: %d: vp is %dx%d+%d+%d",
-               blurb(), ssi->number,
-               *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
-         in multiples of 8 pixels when in 8-bit mode, and in multiples of 4
-         pixels in 16-bit mode.  I don't know what it does in 24- and 32-bit
-         mode, because I don't have enough video memory to find out.
-
-         I consider it a bug that XF86VidModeGetViewPort() is telling me the
-         server's *target* scroll position rather than the server's *actual*
-         scroll position.  David Dawes agrees, and says they may fix this in
-         XFree86 4.0, but it's notrivial.
-
-         He also confirms that this behavior is server-dependent, so the
-         actual scroll position cannot be reliably determined by the client.
-         So... that means the only solution is to provide a ``sandbox''
-         around the blackout window -- we make the window be up to N pixels
-         larger than the viewport on both the left and right sides.  That
-         means some part of the outer edges of each hack might not be
-         visible, but screw it.
-
-         I'm going to guess that 16 pixels is enough, and that the Y dimension
-         doesn't have this problem.
-
-         The drawback of doing this, of course, is that some of the screenhacks
-         will still look pretty stupid -- for example, "slidescreen" will cut
-         off the left and right edges of the grid, etc.
-      */
-#  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.
-             Increase width by 2*FUDGE in case some server rounds up.
-           */
-          *x_ret = ((x - 1) / FUDGE) * FUDGE;
-          *w_ret += (FUDGE * 2);
-        }
-#  undef FUDGE
-
-      if (*x_ret != x ||
-          *y_ret != y ||
-          *w_ret != ml.hdisplay ||
-          *h_ret != ml.vdisplay)
-        sprintf (msg + strlen(msg), "; fudged to %dx%d+%d+%d",
-                 *w_ret, *h_ret, *x_ret, *y_ret);
-
-      if (verbose_p)
-        fprintf (stderr, "%s.\n", msg);
-
-      return;
-    }
-
-# endif /* HAVE_XF86VMODE */
-
-  *x_ret = 0;
-  *y_ret = 0;
-  *w_ret = w;
-  *h_ret = h;
-}
-
-
 static Bool error_handler_hit_p = False;
 
 static int
@@ -1318,7 +1110,7 @@ safe_XKillClient (Display *dpy, XID id)
 
 
 #ifdef HAVE_XF86VMODE
-static Bool
+Bool
 safe_XF86VidModeGetViewPort (Display *dpy, int screen, int *xP, int *yP)
 {
   Bool result;
@@ -1362,13 +1154,9 @@ initialize_screensaver_window_1 (saver_screen_info *ssi)
   XColor black;
   XSetWindowAttributes attrs;
   unsigned long attrmask;
-  int x, y, width, height;
   static Bool printed_visual_info = False;  /* only print the message once. */
   Window horked_window = 0;
 
-  get_screen_viewport (ssi, &x, &y, &width, &height, -1, -1,
-                       (p->verbose_p && !si->screen_blanked_p));
-
   black.red = black.green = black.blue = 0;
 
   if (ssi->cmap == DefaultColormapOfScreen (ssi->screen))
@@ -1421,13 +1209,6 @@ initialize_screensaver_window_1 (saver_screen_info *ssi)
   attrs.backing_pixel = ssi->black_pixel;
   attrs.border_pixel = ssi->black_pixel;
 
-  if (p->debug_p
-# ifdef QUAD_MODE
-      && !p->quad_p
-# endif
-      )
-    width = width / 2;
-
   if (!p->verbose_p || printed_visual_info)
     ;
   else if (ssi->current_visual == DefaultVisualOfScreen (ssi->screen))
@@ -1503,10 +1284,10 @@ initialize_screensaver_window_1 (saver_screen_info *ssi)
     {
       XWindowChanges changes;
       unsigned int changesmask = CWX|CWY|CWWidth|CWHeight|CWBorderWidth;
-      changes.x = x;
-      changes.y = y;
-      changes.width = width;
-      changes.height = height;
+      changes.x = ssi->x;
+      changes.y = ssi->y;
+      changes.width = ssi->width;
+      changes.height = ssi->height;
       changes.border_width = 0;
 
       if (! (safe_XConfigureWindow (si->dpy, ssi->screensaver_window,
@@ -1523,10 +1304,9 @@ initialize_screensaver_window_1 (saver_screen_info *ssi)
     {
       ssi->screensaver_window =
        XCreateWindow (si->dpy, RootWindowOfScreen (ssi->screen),
-                       x, y, width, height,
+                       ssi->x, ssi->y, ssi->width, ssi->height,
                        0, ssi->current_depth, InputOutput,
                       ssi->current_visual, attrmask, &attrs);
-
       reset_stderr (ssi);
 
       if (horked_window)
@@ -1578,10 +1358,10 @@ 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.
+/* Called when the RANDR (Resize and Rotate) extension tells us that
+   the size of the screen has changed while the screen was blanked.
+   Call update_screen_layout() first, then call this to synchronize
+   the size of the saver windows to the new sizes of the screens.
  */
 void
 resize_screensaver_window (saver_info *si)
@@ -1589,132 +1369,97 @@ 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)
+  for (i = 0; i < si->nscreens; i++)
     {
-      /* 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) {
-        /* Apparently some Xinerama implementations let you use a hot-key
-           to change the number of screens in use!  This is, of course,
-           documented nowhere.  Let's try to do something marginally less
-           bad than crashing.
-         */
-        fprintf (stderr, "%s: bad craziness: xinerama screen count changed "
-                 "from %d to %d!\n", blurb(), si->nscreens, nscreens);
-        if (nscreens > si->nscreens)
-          nscreens = si->nscreens;
-      }
+      saver_screen_info *ssi = &si->screens[i];
+      XWindowAttributes xgwa;
 
-      if (!xsi) abort();
-      for (i = 0; i < nscreens; i++)
+      /* Make sure a window exists -- it might not if a monitor was just
+         added for the first time.
+       */
+      if (! ssi->screensaver_window)
         {
-          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))
+          initialize_screensaver_window_1 (ssi);
+          if (p->verbose_p)
             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;
+                     "%s: %d: newly added window 0x%lx %dx%d+%d+%d\n",
+                     blurb(), i, (unsigned long) ssi->screensaver_window,
+                     ssi->width, ssi->height, ssi->x, ssi->y);
         }
-      XFree (xsi);
-    }
-  else
-# endif /* HAVE_XINERAMA */
-    {
-      /* Not Xinerama -- get the real sizes of the root windows. */
-      for (i = 0; i < si->nscreens; i++)
+
+      /* Make sure the window is the right size -- it might not be if
+         the monitor changed resolution, or if a badly-behaved hack
+         screwed with it.
+       */
+      XGetWindowAttributes (si->dpy, ssi->screensaver_window, &xgwa);
+      if (xgwa.x      != ssi->x ||
+          xgwa.y      != ssi->y ||
+          xgwa.width  != ssi->width ||
+          xgwa.height != ssi->height)
         {
-          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))
+          XWindowChanges changes;
+          unsigned int changesmask = CWX|CWY|CWWidth|CWHeight|CWBorderWidth;
+          changes.x      = ssi->x;
+          changes.y      = ssi->y;
+          changes.width  = ssi->width;
+          changes.height = ssi->height;
+          changes.border_width = 0;
+
+          if (p->verbose_p)
             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;
+                     "%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,
+                     ssi->width, ssi->height, ssi->x, ssi->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);
+        }
+
+      /* Now (if blanked) make sure that it's mapped and running a hack --
+         it might not be if we just added it.  (We also might be re-using
+         an old window that existed for a previous monitor that was
+         removed and re-added.)
+
+         Note that spawn_screenhack() calls select_visual() which may destroy
+         and re-create the window via initialize_screensaver_window_1().
+       */
+      if (si->screen_blanked_p)
+        {
+          if (ssi->cmap)
+            XInstallColormap (si->dpy, ssi->cmap);
+          XMapRaised (si->dpy, ssi->screensaver_window);
+          if (! ssi->pid)
+            spawn_screenhack (ssi);
+
+          /* Make sure the act of adding a screen doesn't present as 
+             pointer motion (and thus cause an unblank). */
+          {
+            Window root, child;
+            int x, y;
+            unsigned int mask;
+            XQueryPointer (si->dpy, ssi->screensaver_window, &root, &child,
+                           &ssi->poll_mouse_last_root_x,
+                           &ssi->poll_mouse_last_root_y,
+                           &x, &y, &mask);
+          }
         }
     }
 
-  /* 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.
+  /* Kill off any savers running on no-longer-extant monitors.
    */
-
-  for (i = 0; i < si->nscreens; i++)
+  for (; i < si->ssi_count; 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
-# ifdef QUAD_MODE
-          && !p->quad_p
-# endif
-          ) 
-        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))
+      if (ssi->pid)
+        kill_screenhack (ssi);
+      if (ssi->screensaver_window)
         {
-          fprintf (stderr,
-    "%s: %d: someone horked our saver window (0x%lx)!  Unable to resize it!\n",
-                   blurb(), i, (unsigned long) ssi->screensaver_window);
+          XUnmapWindow (si->dpy, ssi->screensaver_window);
+          restore_real_vroot_1 (ssi);
         }
     }
 }
@@ -2094,10 +1839,30 @@ maybe_transfer_grabs (saver_screen_info *ssi,
 }
 
 
+static Visual *
+get_screen_gl_visual (saver_info *si, int real_screen_number)
+{
+  int i;
+  int nscreens = ScreenCount (si->dpy);
+
+  if (! si->best_gl_visuals)
+    si->best_gl_visuals = (Visual **) 
+      calloc (nscreens + 1, sizeof (*si->best_gl_visuals));
+
+  for (i = 0; i < nscreens; i++)
+    if (! si->best_gl_visuals[i])
+      si->best_gl_visuals[i] = 
+        get_best_gl_visual (si, ScreenOfDisplay (si->dpy, i));
+
+  if (real_screen_number < 0 || real_screen_number >= nscreens) abort();
+  return si->best_gl_visuals[real_screen_number];
+}
+
 
 Bool
 select_visual (saver_screen_info *ssi, const char *visual_name)
 {
+  XWindowAttributes xgwa;
   saver_info *si = ssi->global;
   saver_preferences *p = &si->prefs;
   Bool install_cmap_p = p->install_cmap_p;
@@ -2112,6 +1877,17 @@ select_visual (saver_screen_info *ssi, const char *visual_name)
    */
   Bool always_recreate_window_p = True;
 
+  get_screen_gl_visual (si, 0);   /* let's probe all the GL visuals early */
+
+  /* We make sure the existing window is actually on ssi->screen before
+     trying to use it, in case things moved around radically when monitors
+     were added or deleted.  If we don't do this we could get a BadMatch
+     even though the depths match.  I think.
+   */
+  memset (&xgwa, 0, sizeof(xgwa));
+  if (ssi->screensaver_window)
+    XGetWindowAttributes (si->dpy, ssi->screensaver_window, &xgwa);
+
   if (visual_name && *visual_name)
     {
       if (!strcmp(visual_name, "default-i") ||
@@ -2133,7 +1909,7 @@ select_visual (saver_screen_info *ssi, const char *visual_name)
                !strcmp(visual_name, "Gl") ||
                !strcmp(visual_name, "GL"))
         {
-          new_v = ssi->best_gl_visual;
+          new_v = get_screen_gl_visual (si, ssi->real_screen_number);
           if (!new_v && p->verbose_p)
             fprintf (stderr, "%s: no GL visuals.\n", progname);
         }
@@ -2154,13 +1930,16 @@ select_visual (saver_screen_info *ssi, const char *visual_name)
 
   ssi->install_cmap_p = install_cmap_p;
 
-  if (new_v &&
-      (always_recreate_window_p ||
-       (ssi->current_visual != new_v) ||
-       (install_cmap_p != was_installed_p)))
+  if ((ssi->screen != xgwa.screen) ||
+      (new_v &&
+       (always_recreate_window_p ||
+        (ssi->current_visual != new_v) ||
+        (install_cmap_p != was_installed_p))))
     {
       Colormap old_c = ssi->cmap;
       Window old_w = ssi->screensaver_window;
+      if (! new_v) 
+        new_v = ssi->current_visual;
 
       if (p->verbose_p)
        {
index de507a0..5ec7441 100644 (file)
@@ -108,9 +108,9 @@ usage: %s -<option>\n\
                 (Note that one must *never* kill xscreensaver with -9!)\n\
 \n\
   -restart      Causes the screensaver process to exit and then restart with\n\
-                the same command line arguments as last time.  Do this after\n\
-                you've changed your X resource settings, to cause\n\
-                xscreensaver to notice the changes.\n\
+                the same command line arguments as last time.  You shouldn't\n\
+                really need to do this, since xscreensaver notices when the\n\
+                .xscreensaver file has changed and re-reads it as needed.\n\
 \n\
   -lock         Tells the running xscreensaver process to lock the screen\n\
                 immediately.  This is like -activate, but forces locking as\n\
index 2961a91..835b615 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/scratchbox/tools/bin/perl -w
 # Copyright Â© 2001-2008 Jamie Zawinski <jwz@jwz.org>.
 #
 # Permission to use, copy, modify, distribute, and sell this software and its
index 32117ff..793faf9 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/scratchbox/tools/bin/perl -w
 # Copyright Â© 2001-2008 Jamie Zawinski <jwz@jwz.org>.
 #
 # Permission to use, copy, modify, distribute, and sell this software and its
@@ -33,6 +33,8 @@ my $version  = q{ $Revision: 1.18 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
 
 my $tmpdir   = $ENV{TMPDIR} || "/tmp";
 my $tmpfile  = sprintf("%s/xssv.%08x.ppm", $tmpdir, rand(0xFFFFFFFF));
+my $tmpfile1 = sprintf ("%s/xssgv01.ppm", $tmpdir, rand(0xFFFFFFFF));
+my $tmpfile3 = sprintf ("%s/xssgv03.ppm", $tmpdir, rand(0xFFFFFFFF));
 
 my $verbose           = 0;
 my $use_stdout_p      = 0;
@@ -47,7 +49,7 @@ my $return_filename_p = 0;
 # If you add other programs to this list, please let me know!
 #
 my @programs = (
-
+  "streamer -a -t3 -r1 -o $tmpfile1; mv $tmpfile3 $tmpfile",           # XawTV after 2 sec
   "bttvgrab -d q -Q -l 1 -o ppm -f $tmpfile",  # BTTV
   "qcam > $tmpfile",                           # Connectix Qcam
   "gqcam -t PPM -d $tmpfile",                  # GTK+ Qcam clone
index 2f73725..d7046d6 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/scratchbox/tools/bin/perl -w
 # Copyright Â© 2005-2008 Jamie Zawinski <jwz@jwz.org>
 #
 # Permission to use, copy, modify, distribute, and sell this software and its
index 92b2862..2fb1ecd 100644 (file)
@@ -46,6 +46,8 @@
  *   via the $XSCREENSAVER_WINDOW environment variable -- this trick requires
  *   a recent (Aug 2003) revision of vroot.h.
  *
+ *   (See comments in screens.c for more details about Xinerama/RANDR stuff.)
+ *
  *   While we are waiting for user activity, we also set up timers so that,
  *   after a certain amount of time has passed, we can start a different
  *   screenhack.  We do this by killing the running child process with
@@ -205,6 +207,7 @@ static XrmOptionDescRec options [] = {
 
   /* useful for debugging */
   { "-no-capture-stderr",  ".captureStderr",   XrmoptionNoArg, "off" },
+  { "-log",               ".logFile",          XrmoptionSepArg, 0 },
 };
 
 #ifdef __GNUC__
@@ -263,7 +266,7 @@ timestring (void)
   return str;
 }
 
-static Bool blurb_timestamp_p = False;   /* kludge */
+static Bool blurb_timestamp_p = True;   /* kludge */
 
 const char *
 blurb (void)
@@ -334,27 +337,30 @@ saver_ehandler (Display *dpy, XErrorEvent *error)
        }
       else
        {
+#ifdef __GNUC__
+  __extension__   /* don't warn about "string length is greater than the
+                     length ISO C89 compilers are required to support". */
+#endif
           fprintf (real_stderr,
-                   "#######################################"
-                   "#######################################\n\n");
-          fprintf (real_stderr,
+   "#######################################################################\n"
+   "\n"
    "    If at all possible, please re-run xscreensaver with the command\n"
-   "    line arguments `-sync -verbose -no-capture', and reproduce this\n"
+   "    line arguments `-sync -verbose -log log.txt', and reproduce this\n"
    "    bug.  That will cause xscreensaver to dump a `core' file to the\n"
    "    current directory.  Please include the stack trace from that core\n"
-   "    file in your bug report.  *DO NOT* mail the core file itself!\n"
-   "    That won't work.\n");
-          fprintf (real_stderr,
+   "    file in your bug report.  *DO NOT* mail the core file itself!  That\n"
+   "    won't work.  A \"log.txt\" file will also be written.  Please *do*\n"
+   "    include the complete \"log.txt\" file with your bug report.\n"
    "\n"
    "    http://www.jwz.org/xscreensaver/bugs.html explains how to create\n"
    "    the most useful bug reports, and how to examine core files.\n"
    "\n"
    "    The more information you can provide, the better.  But please\n"
    "    report this bug, regardless!\n"
+   "\n"
+   "#######################################################################\n"
+   "\n"
    "\n");
-          fprintf (real_stderr,
-                   "#######################################"
-                   "#######################################\n\n");
 
          saver_exit (si, -1, 0);
        }
@@ -658,13 +664,6 @@ process_command_line (saver_info *si, int *argc, char **argv)
     with `xscreensaver-demo' or `xscreensaver-command'.\n\
 .   See the man pages for details, or check the web page:\n\
     http://www.jwz.org/xscreensaver/\n\n");
-
-             /* Since version 1.21 renamed the "-lock" option to "-lock-mode",
-                suggest that explicitly. */
-             if (!strcmp (s, "-lock"))
-               fprintf (stderr, "\
-    Or perhaps you meant either the \"-lock-mode\" or the\n\
-    \"-lock-timeout <minutes>\" options to xscreensaver?\n\n");
            }
 
          exit (1);
@@ -755,110 +754,24 @@ print_lock_failure_banner (saver_info *si)
 }
 
 
-#ifdef HAVE_XINERAMA
-
-static Bool
-screens_overlap_p (XineramaScreenInfo *a, XineramaScreenInfo *b)
-{
-  /* Two rectangles overlap if the max of the tops is less than the
-     min of the bottoms and the max of the lefts is less than the min
-     of the rights.
-   */
-# undef MAX
-# undef MIN
-# define MAX(A,B) ((A)>(B)?(A):(B))
-# define MIN(A,B) ((A)<(B)?(A):(B))
-
-  int maxleft  = MAX(a->x_org, b->x_org);
-  int maxtop   = MAX(a->y_org, b->y_org);
-  int minright = MIN(a->x_org + a->width  - 1, b->x_org + b->width);
-  int minbot   = MIN(a->y_org + a->height - 1, b->y_org + b->height);
-  return (maxtop < minbot && maxleft < minright);
-}
-
-
-/* Go through the list of Xinerama screen descriptions, and mark the
-   ones that appear to be insane, so that we don't use them.
- */
-static void
-check_xinerama_sanity (int count, Bool verbose_p, XineramaScreenInfo *xsi)
+/* called from screens.c so that all the Xt crud is here. */
+void
+initialize_screen_root_widget (saver_screen_info *ssi)
 {
-  static Bool printed_p = False;
-  int i, j;
-  char err[1024];
-  *err = 0;
-
-# define X1 xsi[i].x_org
-# define X2 xsi[j].x_org
-# define Y1 xsi[i].y_org
-# define Y2 xsi[j].y_org
-# define W1 xsi[i].width
-# define W2 xsi[j].width
-# define H1 xsi[i].height
-# define H2 xsi[j].height
-
-# define WHINE() do {                                                        \
-    if (verbose_p) {                                                         \
-      if (! printed_p) {                                                     \
-        fprintf (stderr, "%s: compensating for Xinerama braindamage:\n",     \
-                 blurb());                                                   \
-        printed_p = True;                                                    \
-      }                                                                      \
-      fprintf (stderr, "%s:   %d: %s\n", blurb(), xsi[i].screen_number,err); \
-    }                                                                        \
-    xsi[i].screen_number = -1;                                               \
-  } while(0)
-
-  /* If a screen is enclosed by any other screen, that's insane.
-   */
-  for (i = 0; i < count; i++)
-    for (j = 0; j < count; j++)
-      if (i != j &&
-          xsi[i].screen_number >= 0 &&
-          xsi[j].screen_number >= 0 &&
-          X1 >= X2 && Y1 >= Y2 && (X1+W1) <= (X2+W2) && (X1+H1) <= (X2+H2))
-        {
-          sprintf (err, "%dx%d+%d+%d enclosed by %dx%d+%d+%d",
-                   W1, H1, X1, Y1,
-                   W2, H2, X2, Y2);
-          WHINE();
-          continue;
-        }
-
-  /* After checking for enclosure, check for other lossage against earlier
-     screens.  We do enclosure first so that we make sure to pick the
-     larger one.
-   */
-  for (i = 0; i < count; i++)
-    for (j = 0; j < i; j++)
-      {
-        if (xsi[i].screen_number < 0) continue; /* already marked */
-
-        *err = 0;
-        if (X1 == X2 && Y1 == Y2 && W1 == W2 && H1 == H2)
-          sprintf (err, "%dx%d+%d+%d duplicated", W1, H1, X1, Y1);
-
-        else if (screens_overlap_p (&xsi[i], &xsi[j]))
-          sprintf (err, "%dx%d+%d+%d overlaps %dx%d+%d+%d",
-                   W1, H1, X1, Y1,
-                   W2, H2, X2, Y2);
-
-        if (*err) WHINE();
-      }
-
-# undef X1
-# undef X2
-# undef Y1
-# undef Y2
-# undef W1
-# undef W2
-# undef H1
-# undef H2
+  saver_info *si = ssi->global;
+  if (ssi->toplevel_shell)
+    XtDestroyWidget (ssi->toplevel_shell);
+  ssi->toplevel_shell =
+    XtVaAppCreateShell (progname, progclass, 
+                        applicationShellWidgetClass,
+                        si->dpy,
+                        XtNscreen, ssi->screen,
+                        XtNvisual, ssi->current_visual,
+                        XtNdepth,  visual_depth (ssi->screen,
+                                                 ssi->current_visual),
+                        NULL);
 }
 
-#endif /* HAVE_XINERAMA */
-
-
 
 /* Examine all of the display's screens, and populate the `saver_screen_info'
    structures.  Make sure this is called after hack_environment() sets $PATH.
@@ -866,182 +779,28 @@ check_xinerama_sanity (int count, Bool verbose_p, XineramaScreenInfo *xsi)
 static void
 initialize_per_screen_info (saver_info *si, Widget toplevel_shell)
 {
-  Bool found_any_writable_cells = False;
   int i;
 
-# ifdef HAVE_XINERAMA
-  {
-    int event, error;
-    si->xinerama_p = (XineramaQueryExtension (si->dpy, &event, &error) &&
-                      XineramaIsActive (si->dpy));
-  }
-
-  if (si->xinerama_p && ScreenCount (si->dpy) != 1)
-    {
-      si->xinerama_p = False;
-      if (si->prefs.verbose_p)
-       fprintf (stderr,
-                 "%s: Xinerama AND %d screens?  Disabling Xinerama support!\n",
-                 blurb(), ScreenCount(si->dpy));
-    }
-
-  if (si->xinerama_p)
-    {
-      int nscreens = 0;
-      XineramaScreenInfo *xsi = XineramaQueryScreens (si->dpy, &nscreens);
-      if (!xsi)
-        si->xinerama_p = False;
-      else
-        {
-          int j = 0;
-          si->screens = (saver_screen_info *)
-            calloc(sizeof(saver_screen_info), nscreens);
-          check_xinerama_sanity (nscreens, si->prefs.verbose_p, xsi);
-          for (i = 0; i < nscreens; i++)
-            {
-              if (xsi[i].screen_number < 0)  /* deemed insane */
-                continue;
-              si->screens[j].x      = xsi[i].x_org;
-              si->screens[j].y      = xsi[i].y_org;
-              si->screens[j].width  = xsi[i].width;
-              si->screens[j].height = xsi[i].height;
-              j++;
-            }
-          si->nscreens = j;
-          XFree (xsi);
-        }
-      si->default_screen = &si->screens[0];
-      si->default_screen->real_screen_p = True;
-    }
-# endif /* !HAVE_XINERAMA */
-
-  if (!si->xinerama_p)
-    {
-      si->nscreens = ScreenCount(si->dpy);
-      si->screens = (saver_screen_info *)
-        calloc(sizeof(saver_screen_info), si->nscreens);
-      si->default_screen = &si->screens[DefaultScreen(si->dpy)];
-
-      for (i = 0; i < si->nscreens; i++)
-        {
-          saver_screen_info *ssi = &si->screens[i];
-          ssi->width  = DisplayWidth  (si->dpy, i);
-          ssi->height = DisplayHeight (si->dpy, i);
-          ssi->real_screen_p = True;
-          ssi->real_screen_number = i;
-        }
-    }
+  update_screen_layout (si);
 
-
-# ifdef QUAD_MODE
-  /* In "quad mode", we use the Xinerama code to pretend that there are 4
-     screens for every physical screen, and run four times as many hacks...
-   */
-  if (si->prefs.quad_p)
-    {
-      int ns2 = si->nscreens * 4;
-      saver_screen_info *ssi2 = (saver_screen_info *)
-        calloc(sizeof(saver_screen_info), ns2);
-
-      for (i = 0; i < si->nscreens; i++)
-        {
-          saver_screen_info *old = &si->screens[i];
-
-          if (si->prefs.debug_p) old->width = old->width / 2;
-
-          ssi2[i*4  ] = *old;
-          ssi2[i*4+1] = *old;
-          ssi2[i*4+2] = *old;
-          ssi2[i*4+3] = *old;
-
-          ssi2[i*4  ].width  /= 2;
-          ssi2[i*4  ].height /= 2;
-
-          ssi2[i*4+1].x      += ssi2[i*4  ].width;
-          ssi2[i*4+1].width  -= ssi2[i*4  ].width;
-          ssi2[i*4+1].height /= 2;
-
-          ssi2[i*4+2].y      += ssi2[i*4  ].height;
-          ssi2[i*4+2].width  /= 2;
-          ssi2[i*4+2].height -= ssi2[i*4  ].height;
-
-          ssi2[i*4+3].x      += ssi2[i*4+2].width;
-          ssi2[i*4+3].y      += ssi2[i*4+2].height;
-          ssi2[i*4+3].width  -= ssi2[i*4+2].width;
-          ssi2[i*4+3].height -= ssi2[i*4+2].height;
-
-          ssi2[i*4+1].real_screen_p = False;
-          ssi2[i*4+2].real_screen_p = False;
-          ssi2[i*4+3].real_screen_p = False;
-        }
-
-      si->nscreens = ns2;
-      free (si->screens);
-      si->screens = ssi2;
-      si->default_screen = &si->screens[DefaultScreen(si->dpy) * 4];
-      si->xinerama_p = True;
-    }
-# endif /* QUAD_MODE */
-
-  /* finish initializing the screens.
+  /* Check to see whether fading is ever possible -- if any of the
+     screens on the display has a PseudoColor visual, then fading can
+     work (on at least some screens.)  If no screen has a PseudoColor
+     visual, then don't bother ever trying to fade, because it will
+     just cause a delay without causing any visible effect.
    */
   for (i = 0; i < si->nscreens; i++)
     {
       saver_screen_info *ssi = &si->screens[i];
-      ssi->global = si;
-
-      ssi->number = i;
-      ssi->screen = ScreenOfDisplay (si->dpy, ssi->real_screen_number);
-      ssi->poll_mouse_last_root_x = -1;
-      ssi->poll_mouse_last_root_y = -1;
-
-      if (!si->xinerama_p)
+      if (has_writable_cells (ssi->screen, ssi->current_visual) ||
+          get_visual (ssi->screen, "PseudoColor", True, False) ||
+          get_visual (ssi->screen, "GrayScale", True, False))
         {
-          ssi->width  = WidthOfScreen  (ssi->screen);
-          ssi->height = HeightOfScreen (ssi->screen);
+          si->fading_possible_p = True;
+          break;
         }
-
-      /* Note: we can't use the resource ".visual" because Xt is SO FUCKED. */
-      ssi->default_visual =
-       get_visual_resource (ssi->screen, "visualID", "VisualID", False);
-
-      ssi->current_visual = ssi->default_visual;
-      ssi->current_depth = visual_depth (ssi->screen, ssi->current_visual);
-
-      /* Execute a subprocess to find the GL visual. */
-      ssi->best_gl_visual = get_best_gl_visual (ssi);
-
-      if (ssi == si->default_screen)
-       /* Since this is the default screen, use the one already created. */
-       ssi->toplevel_shell = toplevel_shell;
-      else
-       /* Otherwise, each screen must have its own unmapped root widget. */
-       ssi->toplevel_shell =
-         XtVaAppCreateShell (progname, progclass, applicationShellWidgetClass,
-                             si->dpy,
-                             XtNscreen, ssi->screen,
-                             XtNvisual, ssi->current_visual,
-                             XtNdepth,  visual_depth (ssi->screen,
-                                                      ssi->current_visual),
-                             NULL);
-
-      if (! found_any_writable_cells)
-       {
-         /* Check to see whether fading is ever possible -- if any of the
-            screens on the display has a PseudoColor visual, then fading can
-            work (on at least some screens.)  If no screen has a PseudoColor
-            visual, then don't bother ever trying to fade, because it will
-            just cause a delay without causing any visible effect.
-         */
-         if (has_writable_cells (ssi->screen, ssi->current_visual) ||
-             get_visual (ssi->screen, "PseudoColor", True, False) ||
-             get_visual (ssi->screen, "GrayScale", True, False))
-           found_any_writable_cells = True;
-       }
     }
 
-  si->fading_possible_p = found_any_writable_cells;
-
 #ifdef HAVE_XF86VMODE_GAMMA
   si->fading_possible_p = True;  /* if we can gamma fade, go for it */
 #endif
@@ -1115,15 +874,6 @@ initialize_server_extensions (saver_info *si)
                 blurb());
     }
 
-  /* These are incompatible (or at least, our support for them is...) */
-  if (si->xinerama_p && si->using_mit_saver_extension)
-    {
-      si->using_mit_saver_extension = False;
-      if (p->verbose_p)
-        fprintf (stderr, "%s: Xinerama in use: disabling MIT-SCREEN-SAVER.\n",
-                 blurb());
-    }
-
 #ifdef HAVE_RANDR
   query_randr_extension (si);
 #endif
@@ -1149,6 +899,26 @@ initialize_server_extensions (saver_info *si)
 }
 
 
+#ifdef DEBUG_MULTISCREEN
+static void
+debug_multiscreen_timer (XtPointer closure, XtIntervalId *id)
+{
+  saver_info *si = (saver_info *) closure;
+  saver_preferences *p = &si->prefs;
+  if (update_screen_layout (si))
+    {
+      if (p->verbose_p)
+        {
+          fprintf (stderr, "%s: new layout:\n", blurb());
+          describe_monitor_layout (si);
+        }
+      resize_screensaver_window (si);
+    }
+  XtAppAddTimeOut (si->app, 1000*4, debug_multiscreen_timer, (XtPointer) si);
+}
+#endif /* DEBUG_MULTISCREEN */
+
+
 /* For the case where we aren't using an server extensions, select user events
    on all the existing windows, and launch timers to select events on
    newly-created windows as well.
@@ -1201,6 +971,10 @@ select_events (saver_info *si)
 
   if (p->verbose_p)
     fprintf (stderr, " done.\n");
+
+# ifdef DEBUG_MULTISCREEN
+  if (p->debug_p) debug_multiscreen_timer ((XtPointer) si, 0);
+# endif
 }
 
 
@@ -1247,6 +1021,7 @@ main_loop (saver_info *si)
 {
   saver_preferences *p = &si->prefs;
   Bool ok_to_unblank;
+  int i;
 
   while (1)
     {
@@ -1342,12 +1117,15 @@ main_loop (saver_info *si)
             }
         }
 
-      kill_screenhack (si);
+      for (i = 0; i < si->nscreens; i++)
+        kill_screenhack (&si->screens[i]);
 
-      if (!si->throttled_p)
-        spawn_screenhack (si, True);
-      else if (p->verbose_p)
+      raise_window (si, True, True, False);
+      if (si->throttled_p)
         fprintf (stderr, "%s: not launching hack (throttled.)\n", blurb());
+      else
+        for (i = 0; i < si->nscreens; i++)
+          spawn_screenhack (&si->screens[i]);
 
       /* Don't start the cycle timer in demo mode. */
       if (!si->demoing_p && p->cycle)
@@ -1418,14 +1196,16 @@ main_loop (saver_info *si)
 
             was_locked = True;
            si->dbox_up_p = True;
-           suspend_screenhack (si, True);
+            for (i = 0; i < si->nscreens; i++)
+              suspend_screenhack (&si->screens[i], True);        /* suspend */
            XUndefineCursor (si->dpy, ssi->screensaver_window);
 
            ok_to_unblank = unlock_p (si);
 
            si->dbox_up_p = False;
            XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
-           suspend_screenhack (si, False);     /* resume */
+            for (i = 0; i < si->nscreens; i++)
+              suspend_screenhack (&si->screens[i], False);        /* resume */
 
             if (!ok_to_unblank &&
                 !screenhack_running_p (si))
@@ -1451,7 +1231,8 @@ main_loop (saver_info *si)
                 blurb(), timestring ());
 
       /* Kill before unblanking, to stop drawing as soon as possible. */
-      kill_screenhack (si);
+      for (i = 0; i < si->nscreens; i++)
+        kill_screenhack (&si->screens[i]);
       unblank_screen (si);
 
       set_locked_p (si, False);
@@ -1530,6 +1311,7 @@ main (int argc, char **argv)
 
   shell = connect_to_server (si, &argc, argv);
   process_command_line (si, &argc, argv);
+  stderr_log_file (si);
   print_banner (si);
 
   load_init_file(si->dpy, p); /* must be before initialize_per_screen_info() */
@@ -1951,8 +1733,10 @@ handle_clientmessage (saver_info *si, XEvent *event, Bool until_idle_p)
                                  "exiting.");
          if (! until_idle_p)
            {
+              int i;
+              for (i = 0; i < si->nscreens; i++)
+                kill_screenhack (&si->screens[i]);
              unblank_screen (si);
-             kill_screenhack (si);
              XSync (si->dpy, False);
            }
          saver_exit (si, 0, 0);
@@ -1974,8 +1758,10 @@ handle_clientmessage (saver_info *si, XEvent *event, Bool until_idle_p)
                                  "restarting.");
          if (! until_idle_p)
            {
+              int i;
+              for (i = 0; i < si->nscreens; i++)
+                kill_screenhack (&si->screens[i]);
              unblank_screen (si);
-             kill_screenhack (si);
              XSync (si->dpy, False);
            }
 
@@ -2254,17 +2040,15 @@ analyze_display (saver_info *si)
 #     else
         False
 #     endif
+   }, { "DRI",                                 "DRI",
+        True
    }, { "Apple-DRI",                            "Apple-DRI (XDarwin)",
         True
    },
   };
 
-  fprintf (stderr, "%s: running on display \"%s\" (%d %sscreen%s).\n",
-           blurb(),
-          DisplayString(si->dpy),
-           si->nscreens,
-           (si->xinerama_p ? "Xinerama " : ""),
-           (si->nscreens == 1 ? "" : "s"));
+  fprintf (stderr, "%s: running on display \"%s\"\n", blurb(), 
+           DisplayString(si->dpy));
   fprintf (stderr, "%s: vendor is %s, %d.\n", blurb(),
           ServerVendor(si->dpy), VendorRelease(si->dpy));
 
@@ -2324,21 +2108,10 @@ analyze_display (saver_info *si)
        }
     }
 
-  if (si->xinerama_p)
-    {
-      fprintf (stderr, "%s: Xinerama layout:\n", blurb());
-      for (i = 0; i < si->nscreens; i++)
-        {
-          saver_screen_info *ssi = &si->screens[i];
-          fprintf (stderr, "%s:   %c %d/%d: %dx%d+%d+%d\n",
-                   blurb(),
-                   (ssi->real_screen_p ? '+' : ' '),
-                   ssi->number, ssi->real_screen_number,
-                   ssi->width, ssi->height, ssi->x, ssi->y);
-        }
-    }
+  describe_monitor_layout (si);
 }
 
+
 Bool
 display_is_on_console_p (saver_info *si)
 {
index 5490e8e..6c7e317 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993-2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -67,7 +67,10 @@ extern void monitor_power_on (saver_info *si);
    blanking
    ======================================================================= */
 
+extern Bool update_screen_layout (saver_info *si);
 extern void initialize_screensaver_window (saver_info *si);
+extern void initialize_screen_root_widget (saver_screen_info *ssi);
+
 extern void raise_window (saver_info *si,
                            Bool inhibit_fade, Bool between_hacks_p,
                            Bool dont_clear);
@@ -156,12 +159,12 @@ extern void handle_signals (saver_info *si);
 #endif /* !HAVE_SIGACTION */
 extern void unblock_sigchld (void);
 extern void hack_environment (saver_info *si);
-extern void hack_subproc_environment (saver_screen_info *ssi);
+extern void hack_subproc_environment (Screen *, Window saver_window);
 extern void init_sigchld (void);
-extern void spawn_screenhack (saver_info *si, Bool first_time_p);
+extern void spawn_screenhack (saver_screen_info *ssi);
 extern pid_t fork_and_exec (saver_screen_info *ssi, const char *command);
-extern void kill_screenhack (saver_info *si);
-extern void suspend_screenhack (saver_info *si, Bool suspend_p);
+extern void kill_screenhack (saver_screen_info *ssi);
+extern void suspend_screenhack (saver_screen_info *ssi, Bool suspend_p);
 extern Bool screenhack_running_p (saver_info *si);
 extern void emergency_kill_subproc (saver_info *si);
 extern Bool select_visual (saver_screen_info *ssi, const char *visual_name);
@@ -174,6 +177,7 @@ extern const char *signal_name (int signal);
 
 extern FILE *real_stderr;
 extern FILE *real_stdout;
+extern void stderr_log_file (saver_info *si);
 extern void initialize_stderr (saver_info *si);
 extern void reset_stderr (saver_screen_info *ssi);
 extern void clear_stderr (saver_screen_info *ssi);
@@ -194,8 +198,13 @@ extern int BadWindow_ehandler (Display *dpy, XErrorEvent *error);
 extern Bool window_exists_p (Display *dpy, Window window);
 extern char *timestring (void);
 extern Bool display_is_on_console_p (saver_info *si);
-extern Visual *get_best_gl_visual (saver_screen_info *ssi);
+extern Visual *get_best_gl_visual (saver_info *si, Screen *screen);
 extern void check_for_leaks (const char *where);
+extern void describe_monitor_layout (saver_info *si);
+
+#ifdef HAVE_XF86VMODE
+Bool safe_XF86VidModeGetViewPort (Display *, int, int *, int *);
+#endif /* HAVE_XF86VMODE */
 
 extern Atom XA_VROOT, XA_XSETROOT_ID, XA_ESETROOT_PMAP_ID, XA_XROOTPMAP_ID;
 extern Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_ID;
index 9fd23be..f88ba5c 100644 (file)
@@ -621,7 +621,7 @@ lmorph:             lmorph.o        $(HACK_OBJS)
        $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(HACK_LIBS)
 
 maze:          maze.o          $(HACK_OBJS) $(ERASE) $(LOGO)
-       $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(ERASE) $(LOGO) $(HACK_LIBS)
+       $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(ERASE) $(LOGO) $(HACK_LIBS) $(XPM_LIBS)
 
 moire:         moire.o         $(HACK_OBJS) $(COL) $(SHM)
        $(CC_HACK) -o $@ $@.o   $(HACK_OBJS) $(COL) $(SHM) $(HACK_LIBS)
index cde87e4..a43063f 100644 (file)
@@ -117,8 +117,6 @@ static const char *words[] =
   "belly",
   "bliss",
   "bogosity",
-  "boobies",
-  "boobs",
   "booty",
   "bread",
   "bubba",
@@ -131,7 +129,6 @@ static const char *words[] =
   "children",
   "chocolate",
   "CLONE",
-  "cock",
   "constriction",
   "contrition",
   "cop",
@@ -171,7 +168,6 @@ static const char *words[] =
   "fear",
   "fever",
   "filth",
-  "flatulence",
   "fluff",
   "fnord",
   "freedom",
@@ -188,10 +184,7 @@ static const char *words[] =
   "happiness",
   "hate",
   "helplessness",
-  "hemorrhoid",
   "hermaphrodite",
-  "heroin",
-  "heroine",
   "hope",
   "hysteria",
   "icepick",
@@ -265,7 +258,6 @@ static const char *words[] =
   "punishment",
   "punk rock",
   "punk",
-  "pussy",
   "quagmire",
   "quarantine",
   "quartz",
@@ -333,8 +325,6 @@ static const char *words[] =
   "vegetarian",
   "venom",
   "verifiability",
-  "viagra",
-  "vibrator",
   "victim",
   "vignette",
   "villainy",
index b2fd0ad..8d5e3ed 100644 (file)
@@ -535,7 +535,7 @@ static const struct model_s model[] = {
        PIN, ZERO, RIGHT, RIGHT, ZERO, PIN, PIN, ZERO, PIN, PIN, ZERO,
        RIGHT, ZERO }
     },
-    { "k's turd",
+    { "caterpillar",
       { RIGHT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT,
        RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN,
        RIGHT, LEFT, RIGHT, PIN, ZERO }
@@ -560,22 +560,22 @@ static const struct model_s model[] = {
        ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
        ZERO, ZERO, ZERO }
     },
-    { "kissy box",
+    { "ribbon",
       { PIN, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
        ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
        ZERO, PIN, ZERO }
     },
-    { "erect penis",     /* thanks benno */
+    { "shuffle board",     /* thanks benno */
       { PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
        PIN, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,
        ZERO, ZERO }
     },
-    { "flaccid penis",
+    { "anchor",
       { PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
        PIN, ZERO, ZERO, ZERO, RIGHT, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
        ZERO, ZERO }
     },
-    { "vagina",
+    { "engagement ring",
       { RIGHT, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, PIN, ZERO, ZERO,
        LEFT, ZERO, ZERO, ZERO, LEFT, ZERO, LEFT, PIN, LEFT, PIN, RIGHT,
        PIN, RIGHT, ZERO }
@@ -995,7 +995,7 @@ static const struct model_s model[] = {
     { "Parrot",
         { ZERO, ZERO, ZERO, ZERO, RIGHT, RIGHT, ZERO, LEFT, PIN, RIGHT, ZERO, RIGHT, ZERO, RIGHT, ZERO, RIGHT, PIN, LEFT, ZERO, RIGHT, LEFT, ZERO, PIN, ZERO }
     },
-    { "Penis",
+    { "Shuttle",
         { PIN, PIN, RIGHT, ZERO, PIN, PIN, ZERO, PIN, ZERO, ZERO, RIGHT, PIN, LEFT, ZERO, ZERO, PIN, ZERO, PIN, PIN, ZERO, LEFT, PIN, PIN, ZERO }
     },
     { "PictureComingSoon",
old mode 100644 (file)
new mode 100755 (executable)
index 889a37f..737a4b2
Binary files a/xscreensaver/hacks/lcdscrub and b/xscreensaver/hacks/lcdscrub differ
index 5a37723..443d3f4 100644 (file)
@@ -882,6 +882,8 @@ main (int argc, char **argv)
       window = VirtualRootWindowOfScreen (XtScreen (toplevel));
       XtDestroyWidget (toplevel);
       XGetWindowAttributes (dpy, window, &xgwa);
+      /* With RANDR, the root window can resize! */
+      XSelectInput (dpy, window, xgwa.your_event_mask | StructureNotifyMask);
       visual_warning (xgwa.screen, window, xgwa.visual, xgwa.colormap, False);
     }
   else
index 1496495..a732536 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/scratchbox/tools/bin/perl -w
 # vidwhacker, for xscreensaver.  Copyright (c) 1998-2006 Jamie Zawinski.
 #
 # Permission to use, copy, modify, distribute, and sell this software and its
index 2afbeb6..9a2817a 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/scratchbox/tools/bin/perl -w
 #
 # webcollage, Copyright (c) 1999-2005 by Jamie Zawinski <jwz@jwz.org>
 # This program decorates the screen with random images from the web.
index 7df3159..14f3bf2 100644 (file)
@@ -42,7 +42,7 @@
 #include "xpm-pixmap.h"
 #include "analogtv.h"
 
-#include "images/logo-50.xpm"
+#include "images/logo-50-bad.xpm"
 
 /* #define DEBUG 1 */
 /* #define USE_TEST_PATTERNS */
@@ -170,7 +170,7 @@ update_smpte_colorbars(analogtv_input *input)
   ypos += st->ugly_font.char_h*5/2;
 
   analogtv_draw_xpm(st->tv, input,
-                    logo_50_xpm, xpos - 100, ypos);
+                    logo_50_bad_xpm, xpos - 100, ypos);
 
   ypos += 58;