From: Zygo Blaxell Date: Tue, 19 Apr 2011 00:56:15 +0000 (-0400) Subject: http://www.jwz.org/xscreensaver/xscreensaver-5.13.tar.gz X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=commitdiff_plain;h=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21 www.jwz.org/xscreensaver/xscreensaver-5.13.tar.gz -rw-r--r-- 1 zblaxell zblaxell 5923496 Apr 18 17:03 xscreensaver-5.13.tar.gz 3bdac6122e5b7b0cffcc90b3b75dc7fa001c0181 xscreensaver-5.13.tar.gz --- diff --git a/OSX/._XScreenSaver.icns b/OSX/._XScreenSaver.icns index d28a0afd..d8345010 100644 Binary files a/OSX/._XScreenSaver.icns and b/OSX/._XScreenSaver.icns differ diff --git a/OSX/._XScreenSaverDMG.icns b/OSX/._XScreenSaverDMG.icns new file mode 100644 index 00000000..d5f4b862 Binary files /dev/null and b/OSX/._XScreenSaverDMG.icns differ diff --git a/OSX/Makefile b/OSX/Makefile index 2353dc16..0d816049 100644 --- a/OSX/Makefile +++ b/OSX/Makefile @@ -1,13 +1,14 @@ # XScreenSaver for MacOS X, Copyright (c) 2006 by Jamie Zawinski. XCODE_TARGET = "All Savers" +XCODEBUILD=xcodebuild default: release all: debug release clean: -rm -rf build -# cd ..; xcodebuild -target $(XCODE_TARGET) clean +# cd ..; $(XCODEBUILD) -target $(XCODE_TARGET) clean distclean: -rm -f config.status config.cache config.log \ @@ -18,10 +19,10 @@ distclean: distdepend:: update_plist_version debug: distdepend - cd ..; xcodebuild -target $(XCODE_TARGET) -configuration Debug build + cd ..; $(XCODEBUILD) -target $(XCODE_TARGET) -configuration Debug build release:: distdepend - cd ..; xcodebuild -target $(XCODE_TARGET) -configuration Release build + cd ..; $(XCODEBUILD) -target $(XCODE_TARGET) -configuration Release build release:: check_versions diff --git a/OSX/SaverTester.plist b/OSX/SaverTester.plist index d3b021f1..32f32794 100644 --- a/OSX/SaverTester.plist +++ b/OSX/SaverTester.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.12 + 5.13 CFBundleSignature ???? CFBundleVersion - 5.12 + 5.13 LSMinimumSystemVersion 10.4 NSMainNibFile diff --git a/OSX/XScreenSaver.icns b/OSX/XScreenSaver.icns index 15a25c7f..95068d11 100644 Binary files a/OSX/XScreenSaver.icns and b/OSX/XScreenSaver.icns differ diff --git a/OSX/XScreenSaver.plist b/OSX/XScreenSaver.plist index 299defea..a4077419 100644 --- a/OSX/XScreenSaver.plist +++ b/OSX/XScreenSaver.plist @@ -15,11 +15,11 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 5.12 + 5.13 CFBundleSignature ???? CFBundleVersion - 5.12 + 5.13 LSMinimumSystemVersion 10.4 NSMainNibFile diff --git a/OSX/XScreenSaverDMG.icns b/OSX/XScreenSaverDMG.icns index 45745afc..2a38ebd0 100644 Binary files a/OSX/XScreenSaverDMG.icns and b/OSX/XScreenSaverDMG.icns differ diff --git a/OSX/XScreenSaverGLView.m b/OSX/XScreenSaverGLView.m index feccea63..f0632bc9 100644 --- a/OSX/XScreenSaverGLView.m +++ b/OSX/XScreenSaverGLView.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2009 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -108,7 +108,7 @@ init_GL (ModeInfo *mi) if (!ctx) { - NSOpenGLPixelFormatAttribute attrs[20]; + NSOpenGLPixelFormatAttribute attrs[40]; int i = 0; attrs[i++] = NSOpenGLPFAColorSize; attrs[i++] = 24; attrs[i++] = NSOpenGLPFAAlphaSize; attrs[i++] = 8; @@ -117,10 +117,42 @@ init_GL (ModeInfo *mi) if (get_boolean_resource (mi->dpy, "doubleBuffer", "DoubleBuffer")) attrs[i++] = NSOpenGLPFADoubleBuffer; + Bool ms_p = get_boolean_resource (mi->dpy, "multiSample", "MultiSample"); + + /* Sometimes, turning on multisampling kills performance. At one point, + I thought the answer was, "only run multisampling on one screen, and + leave it turned off on other screens". That's what this code does, + but it turns out, that solution is insufficient. I can't really tell + what causes poor performance with multisampling, but it's not + predictable. Without changing the code, some times a given saver will + perform fine with multisampling on, and other times it will perform + very badly. Without multisampling, they always perform fine. + */ +// if (ms_p && [[view window] screen] != [[NSScreen screens] objectAtIndex:0]) +// ms_p = 0; + + if (ms_p) { + attrs[i++] = NSOpenGLPFASampleBuffers; attrs[i++] = 1; + attrs[i++] = NSOpenGLPFASamples; attrs[i++] = 6; + // Don't really understand what this means: + // attrs[i++] = NSOpenGLPFANoRecovery; + } + attrs[i] = 0; - NSOpenGLPixelFormat *pixfmt = [[NSOpenGLPixelFormat alloc] - initWithAttributes:attrs]; + NSOpenGLPixelFormat *pixfmt = + [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs]; + + if (ms_p && !pixfmt) { // Retry without multisampling. + i -= 2; + attrs[i] = 0; + pixfmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs]; + } + + if (! pixfmt) { + NSLog (@"unable to create NSOpenGLPixelFormat"); + exit (1); + } ctx = [[NSOpenGLContext alloc] initWithFormat:pixfmt @@ -131,7 +163,7 @@ init_GL (ModeInfo *mi) // Sync refreshes to the vertical blanking interval GLint r = 1; [ctx setValues:&r forParameter:NSOpenGLCPSwapInterval]; - check_gl_error ("NSOpenGLCPSwapInterval"); +// check_gl_error ("NSOpenGLCPSwapInterval"); // SEGV sometimes. Too early? // #### "Build and Analyze" says that ctx leaks, because it doesn't // seem to realize that makeCurrentContext retains it (right?) @@ -143,6 +175,7 @@ init_GL (ModeInfo *mi) [view setOglContext:ctx]; // Clear frame buffer ASAP, else there are bits left over from other apps. + glClearColor (0, 0, 0, 1); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // glFinish (); // glXSwapBuffers (mi->dpy, mi->window); @@ -161,6 +194,8 @@ init_GL (ModeInfo *mi) } } + check_gl_error ("init_GL"); + // Caller expects a pointer to an opaque struct... which it dereferences. // Don't ask me, it's historical... static int blort = -1; diff --git a/OSX/XScreenSaverView.m b/OSX/XScreenSaverView.m index 7173d86d..d8eea00a 100644 --- a/OSX/XScreenSaverView.m +++ b/OSX/XScreenSaverView.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2010 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -145,7 +145,8 @@ add_default_options (const XrmOptionDescRec *opts, }; static const char *default_defaults [] = { ".doFPS: False", - ".doubleBuffer: True", // for most OpenGL hacks + ".doubleBuffer: True", + ".multiSample: False", ".textMode: date", // ".textLiteral: ", // ".textFile: ", diff --git a/OSX/bindist.rtf b/OSX/bindist.rtf index 4e829f84..980cc099 100644 --- a/OSX/bindist.rtf +++ b/OSX/bindist.rtf @@ -16,8 +16,8 @@ XScreenSaver\ by Jamie Zawinski\ and many others\ \ -version 5.12\ -15-Sep-2010\ +version 5.13\ +18-Apr-2011\ \ {\field{\*\fldinst{HYPERLINK "http://www.jwz.org/xscreensaver/"}}{\fldrslt \cf2 \ul \ulc2 http://www.jwz.org/xscreensaver/}} \ diff --git a/OSX/jwxyz.m b/OSX/jwxyz.m index 604caf50..e96e03b1 100644 --- a/OSX/jwxyz.m +++ b/OSX/jwxyz.m @@ -2418,8 +2418,21 @@ XLoadFont (Display *dpy, const char *name) Font fid = (Font) calloc (1, sizeof(*fid)); fid->nsfont = try_native_font (name, &fid->ps_name, &fid->size); + + if (!fid->nsfont && name && + strchr (name, ' ') && + !strchr (name, '*')) { + // If name contains a space but no stars, it is a native font spec -- + // return NULL so that we know it really didn't exist. Else, it is an + // XLFD font, so keep trying. + XUnloadFont (dpy, fid); + return 0; + } + if (! fid->nsfont) fid->nsfont = try_xlfd_font (name, &fid->ps_name, &fid->size); + + // We should never return NULL for XLFD fonts. if (!fid->nsfont) { NSLog(@"no NSFont for \"%s\"", name); abort(); @@ -2438,14 +2451,17 @@ XFontStruct * XLoadQueryFont (Display *dpy, const char *name) { Font fid = XLoadFont (dpy, name); + if (!fid) return 0; return XQueryFont (dpy, fid); } int XUnloadFont (Display *dpy, Font fid) { - free (fid->ps_name); - free (fid->metrics.per_char); + if (fid->ps_name) + free (fid->ps_name); + if (fid->metrics.per_char) + free (fid->metrics.per_char); // #### DAMMIT! I can't tell what's going wrong here, but I keep getting // crashes in [NSFont ascender] <- query_font, and it seems to go away diff --git a/OSX/osxgrabscreen.m b/OSX/osxgrabscreen.m index f42ad34b..0138fcf4 100644 --- a/OSX/osxgrabscreen.m +++ b/OSX/osxgrabscreen.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2010 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -10,6 +10,11 @@ */ /* This is the OSX implementation of desktop-grabbing and image-loading. + This code is invoked by "utils/grabclient.c", which is linked directly + in to each screen saver bundle. + + X11-based builds of the savers do not use this code (even on MacOS). + This is used only by the Cocoa build of the savers. */ #import @@ -216,8 +221,10 @@ osx_grab_desktop_image (Screen *screen, Window xwindow, Drawable drawable) // Splat the XImage onto the target drawable (probably the window) // and free the bits. // - GC gc = 0; + XGCValues gcv; + GC gc = XCreateGC (dpy, drawable, 0, &gcv); XPutImage (dpy, drawable, gc, xim, 0, 0, 0, 0, xim->width, xim->height); + XFreeGC (dpy, gc); XDestroyImage (xim); } diff --git a/OSX/update-info-plist.pl b/OSX/update-info-plist.pl index 18f52a59..dd2d4569 100755 --- a/OSX/update-info-plist.pl +++ b/OSX/update-info-plist.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2006-2010 Jamie Zawinski +# Copyright © 2006-2011 Jamie Zawinski # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that @@ -23,7 +23,10 @@ require 5; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.14 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.15 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; + +$ENV{PATH} = "/usr/local/bin:$ENV{PATH}"; # for seticon + my $verbose = 1; diff --git a/README b/README index fdb0e5ac..f07d141b 100644 --- a/README +++ b/README @@ -38,6 +38,16 @@ XScreenSaver has an extensive manual -- please read it! =============================================================================== +Changes since 5.12: * Optionally enabled full-scene OpenGL antialiasing. + Set the resource `*multiSample' to true if doing so + doesn't kill performance with your video hardware. + * New version of `glhanoi'. + * Image-loading hacks that display the file name now also + display the sub-directory (xscreensaver-getimage now + returns relative paths under imageDirectory). + * Passwords that contain UTF-8 non-Latin1 chars are now + typeable. + * Numerous minor stability fixes. Changes since 5.11: * Big speed improvement on OSX for heavy XCopyArea users (`xmatrix', `moire2', `phosphor', etc.) * Plugged a bad OSX-only Pixmap leak. diff --git a/README.hacking b/README.hacking index 9be7b88d..718cae2b 100644 --- a/README.hacking +++ b/README.hacking @@ -5,6 +5,19 @@ ========================================================================== +Any program that can be made to render on an X window created by another +process can be used as a screen saver. Just get the window ID out of +$XSCREENSAVER_WINDOW, draw on that, and you're done. + +In theory, you can write a screen saver in any language you like. In +practice, however, languages other than C or C++ tend not to allow you to +draw to windows that they did not create themselves. Unfortunately, this +means that if you want to write a screen saver, you must write it in C. + +Given that you're going to be writing in C, you might as well take +advantage of the various utility functions that I have written to make +that easier. Writing a new screen saver in C using the frameworks +included with xscreensaver simplifies things enormously. Generally, the best way to learn how to do something is to find a similar program, and play around with it until you understand it. Another @@ -14,8 +27,8 @@ xscreensaver demos, included in the "hacks/" directory, rename the file, and edit it until it does what you want. The "Greynetic" and "Deluxe" hacks are probably good ones to start with, -since they are so very simple. For GL programs, "DangerBall" is a good -example. +since they are so very simple. For OpenGL programs, "DangerBall" is a +good example. ========================================================================== diff --git a/config.h.in b/config.h.in index 94185324..8c312597 100644 --- a/config.h.in +++ b/config.h.in @@ -188,11 +188,6 @@ have different names.) (HAVE_GL should be defined too.) */ #undef HAVE_MESA_GL -/* Define this if you have the MIT-SCREEN-SAVER extension installed. See the - caveats about this extension, above. (It's available if - /usr/include/X11/extensions/scrnsaver.h exists.) */ -#undef HAVE_MIT_SAVER_EXTENSION - /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP @@ -267,14 +262,6 @@ /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT -/* Define this if you have the SGI SCREEN_SAVER extension. This is standard on - Irix systems, and not available elsewhere. */ -#undef HAVE_SGI_SAVER_EXTENSION - -/* Define this if you have the SGI-VIDEO-CONTROL extension. This is standard - on Irix systems, and not available elsewhere. */ -#undef HAVE_SGI_VC_EXTENSION - /* Define this if your system uses 'shadow' passwords, that is, the passwords live in /etc/shadow instead of /etc/passwd, and one reads them with getspnam() instead of getpwnam(). (Note that SCO systems do some random @@ -373,14 +360,6 @@ which allows the Ctrl-Sh-Reset key sequence to be temporarily disabled.) */ #undef HAVE_XHPDISABLERESET -/* Define this if you have the XIDLE extension installed. If you have the - XIDLE extension, this is recommended. (You have this extension if the file - /usr/include/X11/extensions/xidle.h exists.) Turning on this flag lets - XScreenSaver work better with servers which support this extension; but it - will still work with servers which do not suport it, so it's a good idea to - compile in support for it if you can. */ -#undef HAVE_XIDLE_EXTENSION - /* Define this if you have the Xinerama extension. This is standard on sufficiently-recent XFree86 systems, and possibly elsewhere. (It's available if the file /usr/include/X11/extensions/Xinerama.h exists.) */ diff --git a/configure b/configure index 5da5195e..666b6414 100755 --- a/configure +++ b/configure @@ -811,9 +811,6 @@ with_x with_hackdir enable_subdir with_configdir -with_sgi_ext -with_xidle_ext -with_sgivc_ext with_dpms_ext with_xinerama_ext with_xinput_ext @@ -853,6 +850,7 @@ LDFLAGS LIBS CPPFLAGS CPP +CPPFLAGS XMKMF' @@ -1501,33 +1499,16 @@ Installation options: --with-x-app-defaults=DIR Where to install xscreensaver configuration file. -Except where noted, all of the --with options below can also take a -directory argument: for example, `--with-motif=/opt/Motif'. That would -cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ -to be added to the -L list, assuming those directories exist. - -By default, support for each of these options will be built in, if the -relevant library routines exist. At run time, they will then be used -only if the X server being used supports them. Each --with option has -a corresponding --without option, to override building support for them -at all. - -Screen blanking and idle-detection options: - - --with-sgi-ext Include support for the SGI SCREEN_SAVER extension. - --with-xidle-ext Include support for the XIDLE extension. - --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension. --with-dpms-ext Include support for the DPMS extension. --with-xinerama-ext Include support for the XINERAMA extension. - --with-xinput-ext Include support for the XInput extension. + --with-xinput-ext Include support for the XInput extension. --with-xf86vmode-ext Include support for XFree86 virtual screens. --with-xf86gamma-ext Include support for XFree86 gamma fading. --with-randr-ext Include support for the X Resize+Rotate extension. --with-proc-interrupts Include support for consulting the /proc/interrupts file to notice keyboard activity. --with-pam Include support for PAM (Pluggable Auth Modules.) - --with-pam-service-name=NAME - NAME is the name of the PAM service that + --with-pam-service-name NAME arg is the name of the PAM service that xscreensaver will authenticate as. --with-kerberos Include support for Kerberos authentication. --with-shadow Include support for shadow password authentication. @@ -1540,7 +1521,7 @@ User interface options: --with-gtk Use the Gtk toolkit for the user interface. --with-motif Use the Motif toolkit for the user interface - (not recommended.) + (no longer supported.) Graphics options: @@ -1556,10 +1537,10 @@ Graphics options: --with-xshm-ext Include support for the Shared Memory extension. --with-xdbe-ext Include support for the DOUBLE-BUFFER extension. --with-readdisplay Include support for the XReadDisplay extension. - --with-image-directory=DIR By default, some demos may display random images - from this directory. + --with-image-directory Arg is the default directory from which some demos + will choose random images to display. --with-text-file=FILE By default, some demos may display this file. - --with-browser=BROWSER Specify the browser to show help URL. + --with-browser=BROWSER Specify the web browser used to show the help URL. --with-setuid-hacks Allow some demos to be installed `setuid root' (which is needed in order to ping other hosts.) @@ -2035,17 +2016,32 @@ echo "command line was: $0 $@" +# This only ever existed in X11R4 and X11R5. +#AH_TEMPLATE([HAVE_XIDLE_EXTENSION], +# [Define this if you have the XIDLE extension installed. If you +# have the XIDLE extension, this is recommended. (You have this +# extension if the file /usr/include/X11/extensions/xidle.h +# exists.) Turning on this flag lets XScreenSaver work better with +# servers which support this extension; but it will still work +# with servers which do not suport it, so it's a good idea to +# compile in support for it if you can.]) +# Using this extension will crash your X server and make fading not work. +#AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION], +# [Define this if you have the MIT-SCREEN-SAVER extension +# installed. See the caveats about this extension, above. +# (It's available if /usr/include/X11/extensions/scrnsaver.h +# exists.)]) +# This only ever existed on SGI hardware. +#AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION], +# [Define this if you have the SGI SCREEN_SAVER extension. This is +# standard on Irix systems, and not available elsewhere.]) - - - - - - - - +# This only ever existed on SGI hardware. +#AH_TEMPLATE([HAVE_SGI_VC_EXTENSION], +# [Define this if you have the SGI-VIDEO-CONTROL extension. This +# is standard on Irix systems, and not available elsewhere.]) @@ -10836,7 +10832,7 @@ fi ############################################################################### # # Handle the --with-configdir option -# Help for --with-x-app-defaults option added.. +# Help for --with-x-app-defaults option added. # ############################################################################### @@ -10876,130 +10872,37 @@ fi # ############################################################################### -have_sgi=no -with_sgi_req=unspecified - -# Check whether --with-sgi-ext was given. -if test "${with_sgi_ext+set}" = set; then - withval=$with_sgi_ext; with_sgi="$withval"; with_sgi_req="$withval" -else - with_sgi=yes -fi - - - - case "$with_sgi" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:$LINENO: checking for SGI SCREEN_SAVER headers" >&5 -$as_echo_n "checking for SGI SCREEN_SAVER headers... " >&6; } - d=$with_sgi/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:$LINENO: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:$LINENO: checking for SGI SCREEN_SAVER libs" >&5 -$as_echo_n "checking for SGI SCREEN_SAVER libs... " >&6; } - d=$with_sgi/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:$LINENO: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_sgi_req="yes" - with_sgi=$with_sgi_req - ;; - - *) - echo "" - echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_sgi" = yes; then - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - { $as_echo "$as_me:$LINENO: checking for X11/extensions/XScreenSaver.h" >&5 -$as_echo_n "checking for X11/extensions/XScreenSaver.h... " >&6; } -if test "${ac_cv_header_X11_extensions_XScreenSaver_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -#include -_ACEOF -rm -rf conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -rf conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_X11_extensions_XScreenSaver_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_X11_extensions_XScreenSaver_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XScreenSaver_h" >&5 -$as_echo "$ac_cv_header_X11_extensions_XScreenSaver_h" >&6; } -if test "x$ac_cv_header_X11_extensions_XScreenSaver_h" = x""yes; then - have_sgi=yes - cat >>confdefs.h <<\_ACEOF -#define HAVE_SGI_SAVER_EXTENSION 1 -_ACEOF - -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - -elif test "$with_sgi" != no; then - echo "error: must be yes or no: --with-sgi-ext=$with_sgi" - exit 1 -fi +#have_sgi=no +#with_sgi_req=unspecified +#AC_ARG_WITH(sgi-ext, +#[Except where noted, all of the --with options below can also take a +#directory argument: for example, `--with-motif=/opt/Motif'. That would +#cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ +#to be added to the -L list, assuming those directories exist. +# +#By default, support for each of these options will be built in, if the +#relevant library routines exist. At run time, they will then be used +#only if the X server being used supports them. Each --with option has +#a corresponding --without option, to override building support for them +#at all. +# +#Screen blanking and idle-detection options: +# +# --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.], +# [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes]) +# +#HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER) +# +#if test "$with_sgi" = yes; then +# AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h, +# [have_sgi=yes +# AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],, +# [#include ]) +# +#elif test "$with_sgi" != no; then +# echo "error: must be yes or no: --with-sgi-ext=$with_sgi" +# exit 1 +#fi ############################################################################### @@ -11008,129 +10911,23 @@ fi # ############################################################################### -have_xidle=no -with_xidle_req=unspecified - -# Check whether --with-xidle-ext was given. -if test "${with_xidle_ext+set}" = set; then - withval=$with_xidle_ext; with_xidle="$withval"; with_xidle_req="$withval" -else - with_xidle=yes -fi - - - - case "$with_xidle" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:$LINENO: checking for XIDLE headers" >&5 -$as_echo_n "checking for XIDLE headers... " >&6; } - d=$with_xidle/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:$LINENO: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:$LINENO: checking for XIDLE libs" >&5 -$as_echo_n "checking for XIDLE libs... " >&6; } - d=$with_xidle/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:$LINENO: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_xidle_req="yes" - with_xidle=$with_xidle_req - ;; - - *) - echo "" - echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_xidle" = yes; then - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - { $as_echo "$as_me:$LINENO: checking for X11/extensions/xidle.h" >&5 -$as_echo_n "checking for X11/extensions/xidle.h... " >&6; } -if test "${ac_cv_header_X11_extensions_xidle_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -#include -_ACEOF -rm -rf conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -rf conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_X11_extensions_xidle_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_X11_extensions_xidle_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_xidle_h" >&5 -$as_echo "$ac_cv_header_X11_extensions_xidle_h" >&6; } -if test "x$ac_cv_header_X11_extensions_xidle_h" = x""yes; then - have_xidle=yes - cat >>confdefs.h <<\_ACEOF -#define HAVE_XIDLE_EXTENSION 1 -_ACEOF - -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" -elif test "$with_xidle" != no; then - echo "error: must be yes or no: --with-xidle-ext=$with_xidle" - exit 1 -fi +#have_xidle=no +#with_xidle_req=unspecified +#AC_ARG_WITH(xidle-ext, +#[ --with-xidle-ext Include support for the XIDLE extension.], +# [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes]) +# +#HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE) +# +#if test "$with_xidle" = yes; then +# AC_CHECK_X_HEADER(X11/extensions/xidle.h, +# [have_xidle=yes +# AC_DEFINE(HAVE_XIDLE_EXTENSION)],, +# [#include ]) +#elif test "$with_xidle" != no; then +# echo "error: must be yes or no: --with-xidle-ext=$with_xidle" +# exit 1 +#fi ############################################################################### @@ -11139,235 +10936,37 @@ fi # ############################################################################### -have_sgivc=no -with_sgivc_req=unspecified - -# Check whether --with-sgivc-ext was given. -if test "${with_sgivc_ext+set}" = set; then - withval=$with_sgivc_ext; with_sgivc="$withval"; with_sgivc_req="$withval" -else - with_sgivc=yes -fi - - - - case "$with_sgivc" in - yes) ;; - no) ;; - - /*) - { $as_echo "$as_me:$LINENO: checking for SGI-VIDEO-CONTROL headers" >&5 -$as_echo_n "checking for SGI-VIDEO-CONTROL headers... " >&6; } - d=$with_sgivc/include - if test -d $d; then - X_CFLAGS="-I$d $X_CFLAGS" - { $as_echo "$as_me:$LINENO: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - { $as_echo "$as_me:$LINENO: checking for SGI-VIDEO-CONTROL libs" >&5 -$as_echo_n "checking for SGI-VIDEO-CONTROL libs... " >&6; } - d=$with_sgivc/lib - if test -d $d; then - X_LIBS="-L$d $X_LIBS" - { $as_echo "$as_me:$LINENO: result: $d" >&5 -$as_echo "$d" >&6; } - else - { $as_echo "$as_me:$LINENO: result: not found ($d: no such directory)" >&5 -$as_echo "not found ($d: no such directory)" >&6; } - fi - - # replace the directory string with "yes". - with_sgivc_req="yes" - with_sgivc=$with_sgivc_req - ;; - - *) - echo "" - echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory." - echo " If it is a directory, then \`DIR/include' will be added to" - echo " the -I list, and \`DIR/lib' will be added to the -L list." - exit 1 - ;; - esac - - -if test "$with_sgivc" = yes; then - - # first check for XSGIvc.h - - ac_save_CPPFLAGS="$CPPFLAGS" - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - { $as_echo "$as_me:$LINENO: checking for X11/extensions/XSGIvc.h" >&5 -$as_echo_n "checking for X11/extensions/XSGIvc.h... " >&6; } -if test "${ac_cv_header_X11_extensions_XSGIvc_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -#include -_ACEOF -rm -rf conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -rf conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_X11_extensions_XSGIvc_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_X11_extensions_XSGIvc_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XSGIvc_h" >&5 -$as_echo "$ac_cv_header_X11_extensions_XSGIvc_h" >&6; } -if test "x$ac_cv_header_X11_extensions_XSGIvc_h" = x""yes; then - have_sgivc=yes -fi - - - CPPFLAGS="$ac_save_CPPFLAGS" - - # if that succeeded, then check for the -lXsgivc - if test "$have_sgivc" = yes; then - have_sgivc=no - - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LDFLAGS="$LDFLAGS" -# ac_save_LIBS="$LIBS" - - if test \! -z "$includedir" ; then - CPPFLAGS="$CPPFLAGS -I$includedir" - fi - # note: $X_CFLAGS includes $x_includes - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - if test \! -z "$libdir" ; then - LDFLAGS="$LDFLAGS -L$libdir" - fi - # note: $X_LIBS includes $x_libraries - LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS" - - CPPFLAGS=`eval eval eval eval eval eval eval eval eval echo $CPPFLAGS` - LDFLAGS=`eval eval eval eval eval eval eval eval eval echo $LDFLAGS` - { $as_echo "$as_me:$LINENO: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5 -$as_echo_n "checking for XSGIvcQueryGammaMap in -lXsgivc... " >&6; } -if test "${ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXsgivc -lXext -lX11 $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 XSGIvcQueryGammaMap (); -int -main () -{ -return XSGIvcQueryGammaMap (); - ; - 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$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 - $as_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 && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap=no -fi - -rm -rf conftest.dSYM -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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" >&5 -$as_echo "$ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" >&6; } -if test "x$ac_cv_lib_Xsgivc_XSGIvcQueryGammaMap" = x""yes; then - have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc" -else - true -fi - - CPPFLAGS="$ac_save_CPPFLAGS" - LDFLAGS="$ac_save_LDFLAGS" -# LIBS="$ac_save_LIBS" - - fi - - # if that succeeded, then we've really got it. - if test "$have_sgivc" = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_SGI_VC_EXTENSION 1 -_ACEOF - - fi - -elif test "$with_sgivc" != no; then - echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc" - exit 1 -fi +#have_sgivc=no +#with_sgivc_req=unspecified +#AC_ARG_WITH(sgivc-ext, +#[ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.], +# [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes]) +# +#HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL) +# +#if test "$with_sgivc" = yes; then +# +# # first check for XSGIvc.h +# AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],, +# [#include ]) +# +# # if that succeeded, then check for the -lXsgivc +# if test "$have_sgivc" = yes; then +# have_sgivc=no +# AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap, +# [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true], +# -lXext -lX11) +# fi +# +# # if that succeeded, then we've really got it. +# if test "$have_sgivc" = yes; then +# AC_DEFINE(HAVE_SGI_VC_EXTENSION) +# fi +# +#elif test "$with_sgivc" != no; then +# echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc" +# exit 1 +#fi ############################################################################### @@ -17763,7 +17362,7 @@ if test "${ac_cv_mesagl_version_string+set}" = set; then $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext < #ifndef MESA_MAJOR_VERSION diff --git a/configure.in b/configure.in index 457af807..0beeff1a 100644 --- a/configure.in +++ b/configure.in @@ -37,28 +37,32 @@ AH_TEMPLATE([HAVE_XHPDISABLERESET], thing which allows the Ctrl-Sh-Reset key sequence to be temporarily disabled.)]) -AH_TEMPLATE([HAVE_XIDLE_EXTENSION], - [Define this if you have the XIDLE extension installed. If you - have the XIDLE extension, this is recommended. (You have this - extension if the file /usr/include/X11/extensions/xidle.h - exists.) Turning on this flag lets XScreenSaver work better with - servers which support this extension; but it will still work - with servers which do not suport it, so it's a good idea to - compile in support for it if you can.]) - -AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION], - [Define this if you have the MIT-SCREEN-SAVER extension - installed. See the caveats about this extension, above. - (It's available if /usr/include/X11/extensions/scrnsaver.h - exists.)]) - -AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION], - [Define this if you have the SGI SCREEN_SAVER extension. This is - standard on Irix systems, and not available elsewhere.]) - -AH_TEMPLATE([HAVE_SGI_VC_EXTENSION], - [Define this if you have the SGI-VIDEO-CONTROL extension. This - is standard on Irix systems, and not available elsewhere.]) +# This only ever existed in X11R4 and X11R5. +#AH_TEMPLATE([HAVE_XIDLE_EXTENSION], +# [Define this if you have the XIDLE extension installed. If you +# have the XIDLE extension, this is recommended. (You have this +# extension if the file /usr/include/X11/extensions/xidle.h +# exists.) Turning on this flag lets XScreenSaver work better with +# servers which support this extension; but it will still work +# with servers which do not suport it, so it's a good idea to +# compile in support for it if you can.]) + +# Using this extension will crash your X server and make fading not work. +#AH_TEMPLATE([HAVE_MIT_SAVER_EXTENSION], +# [Define this if you have the MIT-SCREEN-SAVER extension +# installed. See the caveats about this extension, above. +# (It's available if /usr/include/X11/extensions/scrnsaver.h +# exists.)]) + +# This only ever existed on SGI hardware. +#AH_TEMPLATE([HAVE_SGI_SAVER_EXTENSION], +# [Define this if you have the SGI SCREEN_SAVER extension. This is +# standard on Irix systems, and not available elsewhere.]) + +# This only ever existed on SGI hardware. +#AH_TEMPLATE([HAVE_SGI_VC_EXTENSION], +# [Define this if you have the SGI-VIDEO-CONTROL extension. This +# is standard on Irix systems, and not available elsewhere.]) AH_TEMPLATE([HAVE_DPMS_EXTENSION], [Define this if you have the XDPMS extension. This is standard @@ -1316,7 +1320,7 @@ fi ############################################################################### # # Handle the --with-configdir option -# Help for --with-x-app-defaults option added.. +# Help for --with-x-app-defaults option added. # ############################################################################### @@ -1357,37 +1361,37 @@ fi # ############################################################################### -have_sgi=no -with_sgi_req=unspecified -AC_ARG_WITH(sgi-ext, -[Except where noted, all of the --with options below can also take a -directory argument: for example, `--with-motif=/opt/Motif'. That would -cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ -to be added to the -L list, assuming those directories exist. - -By default, support for each of these options will be built in, if the -relevant library routines exist. At run time, they will then be used -only if the X server being used supports them. Each --with option has -a corresponding --without option, to override building support for them -at all. - -Screen blanking and idle-detection options: - - --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.], - [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes]) - -HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER) - -if test "$with_sgi" = yes; then - AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h, - [have_sgi=yes - AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],, - [#include ]) - -elif test "$with_sgi" != no; then - echo "error: must be yes or no: --with-sgi-ext=$with_sgi" - exit 1 -fi +#have_sgi=no +#with_sgi_req=unspecified +#AC_ARG_WITH(sgi-ext, +#[Except where noted, all of the --with options below can also take a +#directory argument: for example, `--with-motif=/opt/Motif'. That would +#cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/ +#to be added to the -L list, assuming those directories exist. +# +#By default, support for each of these options will be built in, if the +#relevant library routines exist. At run time, they will then be used +#only if the X server being used supports them. Each --with option has +#a corresponding --without option, to override building support for them +#at all. +# +#Screen blanking and idle-detection options: +# +# --with-sgi-ext Include support for the SGI SCREEN_SAVER extension.], +# [with_sgi="$withval"; with_sgi_req="$withval"],[with_sgi=yes]) +# +#HANDLE_X_PATH_ARG(with_sgi, --with-sgi-ext, SGI SCREEN_SAVER) +# +#if test "$with_sgi" = yes; then +# AC_CHECK_X_HEADER(X11/extensions/XScreenSaver.h, +# [have_sgi=yes +# AC_DEFINE(HAVE_SGI_SAVER_EXTENSION)],, +# [#include ]) +# +#elif test "$with_sgi" != no; then +# echo "error: must be yes or no: --with-sgi-ext=$with_sgi" +# exit 1 +#fi ############################################################################### @@ -1396,23 +1400,23 @@ fi # ############################################################################### -have_xidle=no -with_xidle_req=unspecified -AC_ARG_WITH(xidle-ext, -[ --with-xidle-ext Include support for the XIDLE extension.], - [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes]) - -HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE) - -if test "$with_xidle" = yes; then - AC_CHECK_X_HEADER(X11/extensions/xidle.h, - [have_xidle=yes - AC_DEFINE(HAVE_XIDLE_EXTENSION)],, - [#include ]) -elif test "$with_xidle" != no; then - echo "error: must be yes or no: --with-xidle-ext=$with_xidle" - exit 1 -fi +#have_xidle=no +#with_xidle_req=unspecified +#AC_ARG_WITH(xidle-ext, +#[ --with-xidle-ext Include support for the XIDLE extension.], +# [with_xidle="$withval"; with_xidle_req="$withval"],[with_xidle=yes]) +# +#HANDLE_X_PATH_ARG(with_xidle, --with-xidle-ext, XIDLE) +# +#if test "$with_xidle" = yes; then +# AC_CHECK_X_HEADER(X11/extensions/xidle.h, +# [have_xidle=yes +# AC_DEFINE(HAVE_XIDLE_EXTENSION)],, +# [#include ]) +#elif test "$with_xidle" != no; then +# echo "error: must be yes or no: --with-xidle-ext=$with_xidle" +# exit 1 +#fi ############################################################################### @@ -1421,37 +1425,37 @@ fi # ############################################################################### -have_sgivc=no -with_sgivc_req=unspecified -AC_ARG_WITH(sgivc-ext, -[ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.], - [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes]) - -HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL) - -if test "$with_sgivc" = yes; then - - # first check for XSGIvc.h - AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],, - [#include ]) - - # if that succeeded, then check for the -lXsgivc - if test "$have_sgivc" = yes; then - have_sgivc=no - AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap, - [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true], - -lXext -lX11) - fi - - # if that succeeded, then we've really got it. - if test "$have_sgivc" = yes; then - AC_DEFINE(HAVE_SGI_VC_EXTENSION) - fi - -elif test "$with_sgivc" != no; then - echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc" - exit 1 -fi +#have_sgivc=no +#with_sgivc_req=unspecified +#AC_ARG_WITH(sgivc-ext, +#[ --with-sgivc-ext Include support for the SGI-VIDEO-CONTROL extension.], +# [with_sgivc="$withval"; with_sgivc_req="$withval"],[with_sgivc=yes]) +# +#HANDLE_X_PATH_ARG(with_sgivc, --with-sgivc-ext, SGI-VIDEO-CONTROL) +# +#if test "$with_sgivc" = yes; then +# +# # first check for XSGIvc.h +# AC_CHECK_X_HEADER(X11/extensions/XSGIvc.h, [have_sgivc=yes],, +# [#include ]) +# +# # if that succeeded, then check for the -lXsgivc +# if test "$have_sgivc" = yes; then +# have_sgivc=no +# AC_CHECK_X_LIB(Xsgivc, XSGIvcQueryGammaMap, +# [have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"], [true], +# -lXext -lX11) +# fi +# +# # if that succeeded, then we've really got it. +# if test "$have_sgivc" = yes; then +# AC_DEFINE(HAVE_SGI_VC_EXTENSION) +# fi +# +#elif test "$with_sgivc" != no; then +# echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc" +# exit 1 +#fi ############################################################################### @@ -1558,7 +1562,7 @@ fi have_xinput=no with_xinput_req=unspecified AC_ARG_WITH(xinput-ext, -[ --with-xinput-ext Include support for the XInput extension.], +[ --with-xinput-ext Include support for the XInput extension.], [with_xinput="$withval"; with_xinput_req="$withval"], [with_xinput=yes]) HANDLE_X_PATH_ARG(with_xinput, --with-xinput-ext, XINPUT) @@ -1916,8 +1920,8 @@ AC_ARG_WITH(pam, [with_pam="$withval"; with_pam_req="$withval"],[with_pam=$with_pam_default]) AC_ARG_WITH([pam_service_name], - AC_HELP_STRING([--with-pam-service-name=NAME], - [NAME is the name of the PAM service that + AC_HELP_STRING([--with-pam-service-name], + [NAME arg is the name of the PAM service that xscreensaver will authenticate as.]), [pam_service_name="$withval"],[pam_service_name="xscreensaver"]) @@ -2587,7 +2591,7 @@ fi have_motif=no with_motif_req=unspecified AC_ARG_WITH(motif,[ --with-motif Use the Motif toolkit for the user interface - (not recommended.)], + (no longer supported.)], [with_motif="$withval"; with_motif_req="$withval"],[with_motif=no]) HANDLE_X_PATH_ARG(with_motif, --with-motif, Motif) @@ -3408,8 +3412,8 @@ have_imagedir=no with_imagedir_req=unspecified AC_ARG_WITH(image-directory, -[ --with-image-directory=DIR By default, some demos may display random images - from this directory.], +[ --with-image-directory Arg is the default directory from which some demos + will choose random images to display.], [with_imagedir="$withval"; with_imagedir_req="$withval"], [with_imagedir=yes]) # no HANDLE_X_PATH_ARG for this one @@ -3540,7 +3544,7 @@ have_browser=no with_browser_req=unspecified AC_ARG_WITH(browser, -[ --with-browser=BROWSER Specify the browser to show help URL.], +[ --with-browser=BROWSER Specify the web browser used to show the help URL.], [with_browser="$withval"; with_browser_req="$withval"], [with_browser=no ]) # no HANDLE_X_PATH_ARG for this one diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index c12c3cf7..2af4832f 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -4,8 +4,8 @@ ! a screen saver and locker for the X window system ! by Jamie Zawinski ! -! version 5.12 -! 15-Sep-2010 +! version 5.13 +! 18-Apr-2011 ! ! See "man xscreensaver" for more info. The latest version is always ! available at http://www.jwz.org/xscreensaver/ diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c index 28d2925b..5259dc5a 100644 --- a/driver/demo-Gtk.c +++ b/driver/demo-Gtk.c @@ -535,7 +535,7 @@ static void warning_dialog_killk_cb (GtkWidget *widget, gpointer user_data) typedef enum { D_NONE, D_LAUNCH, D_GNOME, D_KDE } dialog_button; -static void +static Bool warning_dialog (GtkWidget *parent, const char *message, dialog_button button_type, int center) { @@ -555,7 +555,7 @@ warning_dialog (GtkWidget *parent, const char *message, !GET_WINDOW (parent)) /* too early to pop up transient dialogs */ { fprintf (stderr, "%s: too early for dialog?\n", progname); - return; + return False; } head = msg; @@ -680,6 +680,7 @@ warning_dialog (GtkWidget *parent, const char *message, #endif /* !HAVE_GTK2 */ free (msg); + return True; } @@ -1485,6 +1486,7 @@ flush_dialog_changes_and_save (state *s) GList *kids = gtk_container_children (GTK_CONTAINER (list_widget)); int i; #endif /* !HAVE_GTK2 */ + static Bool already_warned_about_missing_image_directory = False; /* very long name... */ Bool changed = False; GtkWidget *w; @@ -1587,16 +1589,26 @@ flush_dialog_changes_and_save (state *s) # undef PATHNAME # undef TEXT - /* Warn if the image directory doesn't exist. + /* Warn if the image directory doesn't exist, when: + - not being warned before + - image directory is changed and the directory doesn't exist */ if (p2->image_directory && *p2->image_directory && - !directory_p (p2->image_directory)) + !directory_p (p2->image_directory) && + ( !already_warned_about_missing_image_directory || + ( p->image_directory && + *p->image_directory && + strcmp(p->image_directory, p2->image_directory) + ) + ) + ) { char b[255]; - sprintf (b, "Error:\n\n" "Directory does not exist: \"%s\"\n", + sprintf (b, "Warning:\n\n" "Directory does not exist: \"%s\"\n", p2->image_directory); - warning_dialog (s->toplevel_widget, b, D_NONE, 100); + if (warning_dialog (s->toplevel_widget, b, D_NONE, 100)) + already_warned_about_missing_image_directory = True; } diff --git a/driver/dpms.c b/driver/dpms.c index 526c4bde..3de78f2d 100644 --- a/driver/dpms.c +++ b/driver/dpms.c @@ -1,5 +1,5 @@ /* dpms.c --- syncing the X Display Power Management values - * xscreensaver, Copyright (c) 2001-2009 Jamie Zawinski + * xscreensaver, Copyright (c) 2001-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -217,16 +217,29 @@ monitor_powered_on_p (saver_info *si) } void -monitor_power_on (saver_info *si) +monitor_power_on (saver_info *si, Bool on_p) { - if (!monitor_powered_on_p (si)) + if ((!!on_p) != monitor_powered_on_p (si)) { - DPMSForceLevel(si->dpy, DPMSModeOn); + int event_number, error_number; + if (!DPMSQueryExtension(si->dpy, &event_number, &error_number) || + !DPMSCapable(si->dpy)) + { + if (si->prefs.verbose_p) + fprintf (stderr, + "%s: unable to power %s monitor: no DPMS extension.\n", + blurb(), (on_p ? "on" : "off")); + return; + } + + DPMSForceLevel(si->dpy, (on_p ? DPMSModeOn : DPMSModeOff)); XSync(si->dpy, False); - if (!monitor_powered_on_p (si)) + + if ((!!on_p) != monitor_powered_on_p (si)) /* double-check */ fprintf (stderr, - "%s: DPMSForceLevel(dpy, DPMSModeOn) did not power the monitor on?\n", - blurb()); + "%s: DPMSForceLevel(dpy, %s) did not change monitor power state.\n", + blurb(), + (on_p ? "DPMSModeOn" : "DPMSModeOff")); } } @@ -248,7 +261,7 @@ monitor_powered_on_p (saver_info *si) } void -monitor_power_on (saver_info *si) +monitor_power_on (saver_info *si, Bool on_p) { return; } diff --git a/driver/lock.c b/driver/lock.c index 2886115d..3a84355a 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -1,5 +1,5 @@ /* lock.c --- handling the password dialog for locking-mode. - * xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -83,12 +83,23 @@ vms_passwd_valid_p(char *pw, Bool verbose_p) typedef struct info_dialog_data info_dialog_data; + +#define MAX_BYTES_PER_CHAR 8 /* UTF-8 uses no more than 3, I think */ +#define MAX_PASSWD_CHARS 128 /* Longest possible passphrase */ + struct passwd_dialog_data { saver_screen_info *prompt_screen; int previous_mouse_x, previous_mouse_y; - char typed_passwd [80]; + /* "Characters" in the password may be a variable number of bytes long. + typed_passwd contains the raw bytes. + typed_passwd_char_size indicates the size in bytes of each character, + so that we can make backspace work. + */ + char typed_passwd [MAX_PASSWD_CHARS * MAX_BYTES_PER_CHAR]; + char typed_passwd_char_size [MAX_PASSWD_CHARS]; + XtIntervalId timer; int i_beam; @@ -128,6 +139,7 @@ struct passwd_dialog_data { Pixel foreground; Pixel background; + Pixel border; Pixel passwd_foreground; Pixel passwd_background; Pixel thermo_foreground; @@ -308,6 +320,9 @@ new_passwd_window (saver_info *si) pw->background = get_pixel_resource (si->dpy, cmap, "passwd.background", "Dialog.Background" ); + pw->border = get_pixel_resource (si->dpy, cmap, + "passwd.borderColor", + "Dialog.borderColor"); if (pw->foreground == pw->background) { @@ -330,10 +345,10 @@ new_passwd_window (saver_info *si) "Dialog.Button.Background" ); pw->thermo_foreground = get_pixel_resource (si->dpy, cmap, "passwd.thermometer.foreground", - "Dialog.Thermometer.Foreground" ); + "Dialog.Thermometer.Foreground"); pw->thermo_background = get_pixel_resource ( si->dpy, cmap, "passwd.thermometer.background", - "Dialog.Thermometer.Background" ); + "Dialog.Thermometer.Background"); pw->shadow_top = get_pixel_resource ( si->dpy, cmap, "passwd.topShadowColor", "Dialog.Foreground" ); @@ -341,13 +356,16 @@ new_passwd_window (saver_info *si) "passwd.bottomShadowColor", "Dialog.Background" ); - pw->preferred_logo_width = get_integer_resource (si->dpy, "passwd.logo.width", + pw->preferred_logo_width = get_integer_resource (si->dpy, + "passwd.logo.width", "Dialog.Logo.Width"); - pw->preferred_logo_height = get_integer_resource (si->dpy, "passwd.logo.height", + pw->preferred_logo_height = get_integer_resource (si->dpy, + "passwd.logo.height", "Dialog.Logo.Height"); pw->thermo_width = get_integer_resource (si->dpy, "passwd.thermometer.width", "Dialog.Thermometer.Width"); - pw->internal_border = get_integer_resource (si->dpy, "passwd.internalBorderWidth", + pw->internal_border = get_integer_resource (si->dpy, + "passwd.internalBorderWidth", "Dialog.InternalBorderWidth"); pw->shadow_width = get_integer_resource (si->dpy, "passwd.shadowThickness", "Dialog.ShadowThickness"); @@ -386,10 +404,9 @@ new_passwd_window (saver_info *si) } /* Before mapping the window, save a pixmap of the current screen. - When we lower the window, we - restore these bits. This works, because the running screenhack - has already been sent SIGSTOP, so we know nothing else is drawing - right now! */ + When we lower the window, we restore these bits. This works, + because the running screenhack has already been sent SIGSTOP, so + we know nothing else is drawing right now! */ { XGCValues gcv; GC gc; @@ -413,6 +430,9 @@ new_passwd_window (saver_info *si) } +Bool debug_passwd_window_p = False; /* used only by test-passwd.c */ + + /** * info_msg and prompt may be NULL. */ @@ -507,7 +527,8 @@ make_passwd_window (saver_info *si, h2 += ascent + descent; /* Measure the info_label. */ - if (pw->info_label->overall_width > pw->width) pw->width = pw->info_label->overall_width; + if (pw->info_label->overall_width > pw->width) + pw->width = pw->info_label->overall_width; h2 += pw->info_label->overall_height; /* Measure the user string. */ @@ -532,9 +553,11 @@ make_passwd_window (saver_info *si, /* Measure the prompt_label. */ max_string_width_px -= w3; - pw->prompt_label = mlstring_new(prompt, pw->label_font, max_string_width_px); + pw->prompt_label = mlstring_new (prompt, pw->label_font, + max_string_width_px); - if (pw->prompt_label->overall_width > w2) w2 = pw->prompt_label->overall_width; + if (pw->prompt_label->overall_width > w2) + w2 = pw->prompt_label->overall_width; h2 += pw->prompt_label->overall_height; @@ -590,7 +613,9 @@ make_passwd_window (saver_info *si, /* Use (2 * shadow_width) spacing between the buttons. Another (2 * shadow_width) is required to account for button shadows. */ - w2 = MAX (w2, button_w + pw->unlock_button_width + (pw->shadow_width * 4)); + w2 = MAX (w2, + button_w + pw->unlock_button_width + + (pw->shadow_width * 4)); } if (w2 > pw->width) pw->width = w2; @@ -614,6 +639,9 @@ make_passwd_window (saver_info *si, attrmask |= CWOverrideRedirect; attrs.override_redirect = True; + if (debug_passwd_window_p) + attrs.override_redirect = False; /* kludge for test-passwd.c */ + attrmask |= CWEventMask; attrs.event_mask = (ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask); @@ -648,6 +676,7 @@ make_passwd_window (saver_info *si, DefaultVisualOfScreen(screen), attrmask, &attrs); XSetWindowBackground (si->dpy, si->passwd_dialog, pw->background); + XSetWindowBorder (si->dpy, si->passwd_dialog, pw->border); /* We use the default visual, not ssi->visual, so that the logo pixmap's visual matches that of the si->passwd_dialog window. */ @@ -719,7 +748,7 @@ draw_passwd_window (saver_info *si) pw->date_font->ascent + pw->date_font->descent); if ((strlen(pw->uname_label)) && pw->show_uname_p) - height += (pw->uname_font->ascent + pw->uname_font->descent); /* for uname */ + height += (pw->uname_font->ascent + pw->uname_font->descent); height += ((pw->button_font->ascent + pw->button_font->descent) * 2 + 2 * pw->shadow_width); @@ -820,7 +849,7 @@ draw_passwd_window (saver_info *si) */ if (pw->prompt_label) { - y1 += (spacing + pw->prompt_label->overall_height + pw->shadow_width * 2); + y1 += (spacing + pw->prompt_label->overall_height + pw->shadow_width*2); pw->passwd_field_x = x2 - pw->shadow_width; pw->passwd_field_y = y1 - (pw->passwd_font->ascent + @@ -842,7 +871,7 @@ draw_passwd_window (saver_info *si) if (pw->prompt_label) { - y1 += (spacing + pw->prompt_label->overall_height + pw->shadow_width * 2); + y1 += (spacing + pw->prompt_label->overall_height + pw->shadow_width*2); draw_shaded_rectangle (si->dpy, si->passwd_dialog, x1, y1, x2, y2, pw->shadow_width, @@ -921,7 +950,9 @@ draw_passwd_window (saver_info *si) XSetForeground (si->dpy, gc1, pw->foreground); XSetBackground (si->dpy, gc1, pw->background); XSetClipMask (si->dpy, gc1, pw->logo_clipmask); - XSetClipOrigin (si->dpy, gc1, x1 + ((x2 - (int)w) / 2), y1 + ((y2 - (int)h) / 2)); + XSetClipOrigin (si->dpy, gc1, + x1 + ((x2 - (int)w) / 2), + y1 + ((y2 - (int)h) / 2)); if (d == 1) XCopyPlane (si->dpy, pw->logo_pixmap, si->passwd_dialog, gc1, 0, 0, w, h, @@ -1120,7 +1151,8 @@ update_passwd_window (saver_info *si, const char *printed_passwd, float ratio) x = rects[0].x + rects[0].width - 1; XDrawLine (si->dpy, si->passwd_dialog, gc1, x, y, - x, y + pw->passwd_font->ascent + pw->passwd_font->descent-1); + x, y + pw->passwd_font->ascent + + pw->passwd_font->descent-1); } pw->i_beam = (pw->i_beam + 1) % 4; @@ -1157,8 +1189,10 @@ update_passwd_window (saver_info *si, const char *printed_passwd, float ratio) pw->unlock_button_x, pw->unlock_button_y, pw->unlock_button_width, pw->unlock_button_height, pw->shadow_width, - (pw->unlock_button_down_p ? pw->shadow_bottom : pw->shadow_top), - (pw->unlock_button_down_p ? pw->shadow_top : pw->shadow_bottom), + (pw->unlock_button_down_p ? pw->shadow_bottom : + pw->shadow_top), + (pw->unlock_button_down_p ? pw->shadow_top : + pw->shadow_bottom), pw->unlock_button_down_p); /* The "New Login" button @@ -1234,6 +1268,7 @@ cleanup_passwd_window (saver_info *si) } memset (pw->typed_passwd, 0, sizeof(pw->typed_passwd)); + memset (pw->typed_passwd_char_size, 0, sizeof(pw->typed_passwd_char_size)); memset (pw->passwd_string, 0, strlen(pw->passwd_string)); if (pw->timer) @@ -1693,85 +1728,126 @@ static void handle_passwd_key (saver_info *si, XKeyEvent *event) { passwd_dialog_data *pw = si->pw_data; - int pw_size = sizeof (pw->typed_passwd) - 1; - char *typed_passwd = pw->typed_passwd; - char s[2]; - char *stars = 0; - int i; - int size = XLookupString (event, s, 1, 0, compose_status); + unsigned char decoded [MAX_BYTES_PER_CHAR * 10]; /* leave some slack */ + KeySym keysym = 0; - if (size != 1) return; + /* XLookupString may return more than one character via XRebindKeysym; + and on some systems it returns multi-byte UTF-8 characters (contrary + to its documentation, which says it returns only Latin1.) + */ + int decoded_size = XLookupString (event, (char *)decoded, sizeof(decoded), + &keysym, compose_status); + +#if 0 + { + const char *ks = XKeysymToString (keysym); + int i; + fprintf(stderr, "## %-12s\t=> %d\t", (ks ? ks : "(null)"), decoded_size); + for (i = 0; i < decoded_size; i++) + fprintf(stderr, "%c", decoded[i]); + fprintf(stderr, "\t"); + for (i = 0; i < decoded_size; i++) + fprintf(stderr, "\\%03o", ((unsigned char *)decoded)[i]); + fprintf(stderr, "\n"); + } +#endif - s[1] = 0; + if (decoded_size > MAX_BYTES_PER_CHAR) + { + /* The multi-byte character returned is too large. */ + XBell (si->dpy, 0); + return; + } + decoded[decoded_size] = 0; pw->passwd_changed_p = True; /* Add 10% to the time remaining every time a key is pressed. */ pw->ratio += 0.1; if (pw->ratio > 1) pw->ratio = 1; - switch (*s) + if (decoded_size == 1) /* Handle single-char commands */ { - case '\010': case '\177': /* Backspace */ - if (!*typed_passwd) - XBell (si->dpy, 0); - else - typed_passwd [strlen(typed_passwd)-1] = 0; - break; - - case '\025': case '\030': /* Erase line */ - memset (typed_passwd, 0, pw_size); - break; - - case '\012': case '\015': /* Enter */ - finished_typing_passwd(si, pw); - break; - - case '\033': /* Escape */ - si->unlock_state = ul_cancel; - break; - - default: - /* Though technically the only illegal characters in Unix passwords - are LF and NUL, most GUI programs (e.g., GDM) use regular text-entry - fields that only let you type printable characters. So, people - who use funky characters in their passwords are already broken. - We follow that precedent. - */ - if (isprint ((unsigned char) *s)) + switch (*decoded) { - i = strlen (typed_passwd); - if (i >= pw_size-1) + case '\010': case '\177': /* Backspace */ + { + /* kludgey way to get the number of "logical" characters. */ + int nchars = strlen (pw->typed_passwd_char_size); + int nbytes = strlen (pw->typed_passwd); + if (nbytes <= 0) + XBell (si->dpy, 0); + else + { + int i; + for (i = pw->typed_passwd_char_size[nchars-1]; i >= 0; i--) + { + if (nbytes < 0) abort(); + pw->typed_passwd[nbytes--] = 0; + } + pw->typed_passwd_char_size[nchars-1] = 0; + } + } + break; + + case '\012': case '\015': /* Enter */ + finished_typing_passwd (si, pw); + break; + + case '\033': /* Escape */ + si->unlock_state = ul_cancel; + break; + + case '\025': case '\030': /* Erase line */ + memset (pw->typed_passwd, 0, sizeof (pw->typed_passwd)); + memset (pw->typed_passwd_char_size, 0, + sizeof (pw->typed_passwd_char_size)); + break; + + default: + if (*decoded < ' ' && *decoded != '\t') /* Other ctrl char */ XBell (si->dpy, 0); else - { - typed_passwd [i] = *s; - typed_passwd [i+1] = 0; - } + goto SELF_INSERT; + break; } - else + } + else + { + int nbytes, nchars; + SELF_INSERT: + nbytes = strlen (pw->typed_passwd); + nchars = strlen (pw->typed_passwd_char_size); + if (nchars + 1 >= sizeof (pw->typed_passwd_char_size)-1 || + nbytes + decoded_size >= sizeof (pw->typed_passwd)-1) /* overflow */ XBell (si->dpy, 0); - break; + else + { + pw->typed_passwd_char_size[nchars] = decoded_size; + pw->typed_passwd_char_size[nchars+1] = 0; + memcpy (pw->typed_passwd + nbytes, decoded, decoded_size); + pw->typed_passwd[nbytes + decoded_size] = 0; + } } if (pw->echo_input) { - /* If the input is wider than the text box, only show the last portion. - * This simulates a horizontally scrolling text field. */ + /* If the input is wider than the text box, only show the last portion, + to simulate a horizontally-scrolling text field. */ int chars_in_pwfield = (pw->passwd_field_width / pw->passwd_font->max_bounds.width); - - if (strlen(typed_passwd) > chars_in_pwfield) - typed_passwd += (strlen(typed_passwd) - chars_in_pwfield); - - update_passwd_window(si, typed_passwd, pw->ratio); + const char *output = pw->typed_passwd; + if (strlen(output) > chars_in_pwfield) + output += (strlen(output) - chars_in_pwfield); + update_passwd_window (si, output, pw->ratio); } else if (pw->show_stars_p) { - i = strlen(typed_passwd); - stars = (char *) malloc(i+1); - memset (stars, '*', i); - stars[i] = 0; + int nchars = strlen (pw->typed_passwd_char_size); + char *stars = 0; + stars = (char *) malloc(nchars + 1); + memset (stars, '*', nchars); + stars[nchars] = 0; update_passwd_window (si, stars, pw->ratio); free (stars); } @@ -1823,7 +1899,7 @@ passwd_event_loop (saver_info *si) #ifdef RRScreenChangeNotifyMask /* Inform Xlib that it's ok to update its data structures. */ - XRRUpdateConfiguration(&event.x_event); /* Xrandr.h 1.9, 2002/09/29 */ + XRRUpdateConfiguration(&event.x_event); /* Xrandr.h 1.9, 2002/09/29*/ #endif /* RRScreenChangeNotifyMask */ /* Resize the existing xscreensaver windows and cached ssi data. */ @@ -1911,6 +1987,13 @@ handle_typeahead (saver_info *si) memcpy (pw->typed_passwd, si->unlock_typeahead, i); pw->typed_passwd [i] = 0; + { + int j; + char *c = pw->typed_passwd_char_size; + for (j = 0; j < i; j++) + *c++ = 1; + *c = 0; + } memset (si->unlock_typeahead, '*', strlen(si->unlock_typeahead)); si->unlock_typeahead[i] = 0; @@ -1958,7 +2041,7 @@ remove_trailing_whitespace(const char *str) * passwd dialog. A message sequence of info or error followed by a prompt will * be reduced into a single dialog window. * - * Returns 0 on success or -1 if some problem occurred (cancelled auth, OOM, ...) + * Returns 0 on success or -1 if some problem occurred (cancelled, OOM, etc.) */ int gui_auth_conv(int num_msg, @@ -2054,6 +2137,7 @@ gui_auth_conv(int num_msg, fail: if (compose_status) free (compose_status); + compose_status = 0; if (responses) { diff --git a/driver/prefs.c b/driver/prefs.c index 1df87728..85713935 100644 --- a/driver/prefs.c +++ b/driver/prefs.c @@ -1,5 +1,5 @@ /* dotfile.c --- management of the ~/.xscreensaver file. - * xscreensaver, Copyright (c) 1998-2008 Jamie Zawinski + * xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -297,9 +297,9 @@ static const char * const prefs[] = { "pointerHysteresis", "windowCreationTimeout", "initialDelay", - "sgiSaverExtension", + "sgiSaverExtension", /* not saved -- obsolete */ "mitSaverExtension", /* not saved -- obsolete */ - "xidleExtension", + "xidleExtension", /* not saved -- obsolete */ "GetViewPortIsFullOfLies", "procInterrupts", "xinputExtensionDev", @@ -851,9 +851,9 @@ write_init_file (Display *dpy, CHECK("pointerHysteresis")type = pref_int, i = p->pointer_hysteresis; CHECK("windowCreationTimeout")type=pref_time,t= p->notice_events_timeout; CHECK("initialDelay") type = pref_time, t = p->initial_delay; - CHECK("sgiSaverExtension")type = pref_bool, b=p->use_sgi_saver_extension; + CHECK("sgiSaverExtension") continue; /* don't save */ CHECK("mitSaverExtension") continue; /* don't save */ - CHECK("xidleExtension") type = pref_bool, b = p->use_xidle_extension; + CHECK("xidleExtension") continue; /* don't save */ CHECK("procInterrupts") type = pref_bool, b = p->use_proc_interrupts; CHECK("xinputExtensionDev") type = pref_bool, b = p->use_xinput_extension; CHECK("GetViewPortIsFullOfLies") type = pref_bool, @@ -861,7 +861,7 @@ write_init_file (Display *dpy, CHECK("overlayStderr") type = pref_bool, b = overlay_stderr_p; CHECK("overlayTextBackground") continue; /* don't save */ CHECK("overlayTextForeground") continue; /* don't save */ - CHECK("bourneShell") continue; + CHECK("bourneShell") continue; /* don't save */ else abort(); # undef CHECK @@ -1118,17 +1118,20 @@ load_init_file (Display *dpy, saver_preferences *p) } p->use_xidle_extension = get_boolean_resource (dpy, "xidleExtension","Boolean"); -#if 0 /* ignore this, it is evil. */ - p->use_mit_saver_extension = get_boolean_resource (dpy, - "mitSaverExtension", - "Boolean"); -#endif +#if 0 /* obsolete. */ p->use_sgi_saver_extension = get_boolean_resource (dpy, "sgiSaverExtension", "Boolean"); - +#endif +#if 0 /* obsolete. */ p->use_xinput_extension = get_boolean_resource (dpy, "xinputExtensionDev", "Boolean"); +#endif +#if 0 /* broken and evil. */ + p->use_mit_saver_extension = get_boolean_resource (dpy, + "mitSaverExtension", + "Boolean"); +#endif p->use_proc_interrupts = get_boolean_resource (dpy, "procInterrupts", "Boolean"); diff --git a/driver/splash.c b/driver/splash.c index 491ebe80..02844b58 100644 --- a/driver/splash.c +++ b/driver/splash.c @@ -126,6 +126,7 @@ struct splash_dialog_data { Pixel foreground; Pixel background; + Pixel border; Pixel button_foreground; Pixel button_background; Pixel shadow_top; @@ -241,6 +242,9 @@ make_splash_dialog (saver_info *si) sp->background = get_pixel_resource (si->dpy, cmap, "splash.background", "Dialog.Background"); + sp->border = get_pixel_resource (si->dpy, cmap, + "splash.borderColor", + "Dialog.borderColor"); if (sp->foreground == sp->background) { @@ -420,6 +424,8 @@ make_splash_dialog (saver_info *si) DefaultVisualOfScreen(ssi->screen), attrmask, &attrs); XSetWindowBackground (si->dpy, si->splash_dialog, sp->background); + XSetWindowBorder (si->dpy, si->splash_dialog, sp->border); + sp->logo_pixmap = xscreensaver_logo (ssi->screen, /* same visual as si->splash_dialog */ diff --git a/driver/test-passwd.c b/driver/test-passwd.c index fe0dedb3..65615dd5 100644 --- a/driver/test-passwd.c +++ b/driver/test-passwd.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1998-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -27,6 +27,7 @@ #include #include #include +#include #include "xscreensaver.h" #include "resources.h" @@ -41,7 +42,7 @@ saver_info *global_si_kludge; FILE *real_stderr, *real_stdout; -void monitor_power_on (saver_info *si) {} +void monitor_power_on (saver_info *si, Bool on_p) {} Bool monitor_powered_on_p (saver_info *si) { return True; } void initialize_screensaver_window (saver_info *si) {} void raise_window (saver_info *si, Bool i, Bool b, Bool d) {} @@ -135,6 +136,8 @@ static char *fallback[] = { 0 }; +extern Bool debug_passwd_window_p; /* lock.c kludge */ + int main (int argc, char **argv) { @@ -199,6 +202,11 @@ main (int argc, char **argv) progclass = "XScreenSaver"; + if (!setlocale(LC_ALL,"")) + fprintf (stderr, "%s: warning: could not set default locale\n", + progname); + + if (which != TTY) { toplevel_shell = XtAppInitialize (&si->app, progclass, 0, 0, @@ -243,6 +251,7 @@ main (int argc, char **argv) si->unlock_cb = gui_auth_conv; si->auth_finished_cb = auth_finished_cb; + debug_passwd_window_p = True; xss_authenticate(si, True); if (si->unlock_state == ul_success) diff --git a/driver/timers.c b/driver/timers.c index b079492c..760fd4cc 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -1,5 +1,5 @@ /* timers.c --- detecting when the user is idle, and other timer-related tasks. - * xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -349,7 +349,7 @@ reset_timers (saver_info *si) /* And if the monitor is already powered off, turn it on. You'd think the above would do that, but apparently not? */ - monitor_power_on (si); + monitor_power_on (si, True); #endif } @@ -712,6 +712,8 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) si->using_sgi_saver_extension) || si->using_xinput_extension); + const char *why = 0; /* What caused the idle-state to change? */ + if (until_idle_p) { if (polling_for_idleness) @@ -794,12 +796,14 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) if (idle >= p->timeout) { /* Look, we've been idle long enough. We're done. */ + why = "timeout"; goto DONE; } else if (si->emergency_lock_p) { /* Oops, the wall clock has jumped far into the future, so we need to lock down in a hurry! */ + why = "large wall clock change"; goto DONE; } else @@ -818,7 +822,10 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) case ClientMessage: if (handle_clientmessage (si, &event.x_event, until_idle_p)) - goto DONE; + { + why = "ClientMessage"; + goto DONE; + } break; case CreateNotify: @@ -935,9 +942,15 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) cause deactivation. Only clicks and keypresses do. */ ; else - /* If we're not demoing, then any activity causes deactivation. - */ - goto DONE; + { + /* If we're not demoing, then any activity causes deactivation. + */ + why = (event.x_event.xany.type == MotionNotify ?"mouse motion": + event.x_event.xany.type == KeyPress?"keyboard activity": + event.x_event.xany.type == ButtonPress ? "mouse click" : + "unknown user activity"); + goto DONE; + } } else reset_timers (si); @@ -980,7 +993,10 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) } if (until_idle_p) - goto DONE; + { + why = "MIT ScreenSaverOn"; + goto DONE; + } } else if (event.sevent.state == ScreenSaverOff) { @@ -988,7 +1004,10 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) fprintf (stderr, "%s: MIT ScreenSaverOff event received.\n", blurb()); if (!until_idle_p) - goto DONE; + { + why = "MIT ScreenSaverOff"; + goto DONE; + } } else fprintf (stderr, @@ -1010,7 +1029,10 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) blurb()); if (until_idle_p) - goto DONE; + { + why = "SGI ScreenSaverStart"; + goto DONE; + } } else if (event.x_event.type == (si->sgi_saver_ext_event_number + ScreenSaverEnd)) @@ -1021,29 +1043,38 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) fprintf (stderr, "%s: SGI ScreenSaverEnd event received.\n", blurb()); if (!until_idle_p) - goto DONE; + { + why = "SGI ScreenSaverEnd"; + goto DONE; + } } else #endif /* HAVE_SGI_SAVER_EXTENSION */ #ifdef HAVE_XINPUT - if ((!until_idle_p) && (si->num_xinput_devices > 0) && + if ((!until_idle_p) && + (si->num_xinput_devices > 0) && (event.x_event.type == si->xinput_DeviceMotionNotify || - event.x_event.type == si->xinput_DeviceButtonPress || - event.x_event.type == si->xinput_DeviceButtonRelease )) + event.x_event.type == si->xinput_DeviceButtonPress)) + /* Ignore DeviceButtonRelease, see ButtonRelease comment above. */ { dispatch_event (si, &event.x_event); if (si->demoing_p && - (event.x_event.type == si->xinput_DeviceMotionNotify || - event.x_event.type == si->xinput_DeviceButtonRelease) ) + event.x_event.type == si->xinput_DeviceMotionNotify) /* When we're demoing a single hack, mouse motion doesn't cause deactivation. Only clicks and keypresses do. */ ; else /* If we're not demoing, then any activity causes deactivation. */ - goto DONE; + { + why = (event.x_event.type == si->xinput_DeviceMotionNotify + ? "XI mouse motion" : + event.x_event.type == si->xinput_DeviceButtonPress + ? "XI mouse click" : "unknown XINPUT event"); + goto DONE; + } } else #endif /* HAVE_XINPUT */ @@ -1089,6 +1120,13 @@ sleep_until_idle (saver_info *si, Bool until_idle_p) } DONE: + if (p->verbose_p) + { + if (! why) why = "unknown reason"; + fprintf (stderr, "%s: %s (%s)\n", blurb(), + (until_idle_p ? "user is idle" : "user is active"), + why); + } /* If there's a user event on the queue, swallow it. If we're using a server extension, and the user becomes active, we diff --git a/driver/windows.c b/driver/windows.c index 52c93127..e01a992c 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -1,5 +1,5 @@ /* windows.c --- turning the screen black; dealing with visuals, virtual roots. - * xscreensaver, Copyright (c) 1991-2010 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -1697,7 +1697,7 @@ unblank_screen (saver_info *si) Bool unfade_p = (si->fading_possible_p && p->unfade_p); int i; - monitor_power_on (si); + monitor_power_on (si, True); reset_watchdog_timer (si, False); if (si->demoing_p) diff --git a/driver/xdpyinfo.c b/driver/xdpyinfo.c index 7a0b0783..9f679665 100644 --- a/driver/xdpyinfo.c +++ b/driver/xdpyinfo.c @@ -191,15 +191,28 @@ print_glx_visual_info (dpy, vip) value != 0) printf (" GLX stencil size: %d\n", value); -# ifdef GLX_SAMPLE_BUFFERS_SGIS - if (!glXGetConfig (dpy, vip, GLX_SAMPLE_BUFFERS_SGIS, &value) && - value != 0) +# if defined(GL_SAMPLE_BUFFERS) +# define SB GL_SAMPLE_BUFFERS +# define SM GL_SAMPLES +# elif defined(GLX_SAMPLE_BUFFERS) +# define SB GLX_SAMPLE_BUFFERS +# define SM GLX_SAMPLES +# elif defined(GLX_SAMPLE_BUFFERS_ARB) +# define SB GLX_SAMPLE_BUFFERS_ARB +# define SM GLX_SAMPLES_ARB +# elif defined(GLX_SAMPLE_BUFFERS_SGIS) +# define SB GLX_SAMPLE_BUFFERS_SGIS +# define SM GLX_SAMPLES_SGIS +# endif + +# ifdef SB + if (!glXGetConfig (dpy, vip, SB, &value) && value != 0) { int bufs = value; - if (!glXGetConfig (dpy, vip, GLX_SAMPLES_SGIS, &value)) - printf (" GLX multisamplers: %d (%d)\n", bufs, value); + if (!glXGetConfig (dpy, vip, SM, &value)) + printf (" GLX multisample: %d, %d\n", bufs, value); } -# endif +# endif /* SB */ if (!glXGetConfig (dpy, vip, GLX_TRANSPARENT_TYPE_EXT, &value) && value != GLX_NONE_EXT) diff --git a/driver/xscreensaver-demo.glade2 b/driver/xscreensaver-demo.glade2 index 66de564d..aa40d31b 100644 --- a/driver/xscreensaver-demo.glade2 +++ b/driver/xscreensaver-demo.glade2 @@ -253,7 +253,7 @@ GTK_UPDATE_ALWAYS True False - 1 1 720 1 15 15 + 1 1 720 1 15 0 @@ -285,7 +285,7 @@ GTK_UPDATE_ALWAYS True False - 0 0 720 1 15 15 + 0 0 720 1 15 0 Lock Screen After @@ -320,7 +320,7 @@ GTK_UPDATE_ALWAYS True False - 0 0 720 1 15 15 + 0 0 720 1 15 0 @@ -1944,7 +1944,7 @@ This probably means that the "xscreensaver-extras" and GTK_UPDATE_ALWAYS True False - 0 0 1440 1 15 15 + 0 0 1440 1 15 0 @@ -1977,7 +1977,7 @@ This probably means that the "xscreensaver-extras" and GTK_UPDATE_ALWAYS True False - 0 0 1440 1 15 15 + 0 0 1440 1 15 0 @@ -2010,7 +2010,7 @@ This probably means that the "xscreensaver-extras" and GTK_UPDATE_ALWAYS True False - 0 0 1440 1 15 15 + 0 0 1440 1 15 0 @@ -2243,7 +2243,7 @@ This probably means that the "xscreensaver-extras" and GTK_UPDATE_ALWAYS True False - 0 0 10 1 1 1 + 0 0 10 1 1 0 diff --git a/driver/xscreensaver-getimage-desktop b/driver/xscreensaver-getimage-desktop index 627cd254..12e195be 100755 --- a/driver/xscreensaver-getimage-desktop +++ b/driver/xscreensaver-getimage-desktop @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2003, 2005 Jamie Zawinski . +# Copyright © 2003-2005 Jamie Zawinski . # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that @@ -9,32 +9,32 @@ # software for any purpose. It is provided "as is" without express or # implied warranty. # -# This program attempts to grab an image of the desktop, and then load -# it on to the root window using the "xscreensaver-getimage-file" -# program. Various frame-grabbing programs are known, and the first -# one found is used. # -# NOTE: This script is only used on MacOS X / XDarwin systems, because -# on those systems, it's necessary to use the "screencapture" -# program to get an image of the desktop -- the usual X11 -# mechanism for grabbing the screen doesn't work on OSX. +# This script is invoked by "xscreensaver-getimage" on X11 MacOS systems +# to grab an image of the desktop, and then load it on to the given X11 +# Drawable using the "xscreensaver-getimage-file" program. # -# The various xscreensaver hacks that manipulate images ("slidescreen", -# "jigsaw", etc.) get the image to manipulate by running the -# "xscreensaver-getimage" program. +# This script is only used in an *X11* build on MacOS systems. # -# "xscreensaver-getimage" will invoke this program, depending on the -# value of the "grabDesktopImages" setting in the ~/.xscreensaver file -# (or in /usr/lib/X11/app-defaults/XScreenSaver). +# When running on non-Mac X11 systems, utils/grabscreen.c is used. +# +# However, when running under X11 on MacOS, that usual X11-based +# screen-grabbing mechanism doesn't work, so we need to invoke the +# "/usr/bin/screencapture" program to do it instead. (This script). +# +# However again, for the MacOS-native (Cocoa) build of the screen savers, +# "utils/grabclient.c" instead links against "OSX/osxgrabscreen.m", which +# grabs screen images directly without invoking a sub-process to do it. # # Created: 20-Oct-2003. + require 5; #use diagnostics; # Fails on some MacOS 10.5 systems use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.4 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.5 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my @grabber = ("screencapture", "-x"); my @converter = ("pdf2jpeg"); diff --git a/driver/xscreensaver-getimage-file b/driver/xscreensaver-getimage-file index 6dd262e8..bc7bcbd9 100755 --- a/driver/xscreensaver-getimage-file +++ b/driver/xscreensaver-getimage-file @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001-2009 Jamie Zawinski . +# Copyright © 2001-2011 Jamie Zawinski . # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that @@ -19,6 +19,8 @@ # Under X11, the "xscreensaver-getimage" program invokes this script, # depending on the value of the "chooseRandomImages" and "imageDirectory" # settings in the ~/.xscreensaver file (or .../app-defaults/XScreenSaver). +# The screen savers invoke "xscreensaver-getimage" via utils/grabclient.c, +# which then invokes this script. # # Under Cocoa, this script lives inside the .saver bundle, and is invoked # directly from utils/grabclient.c. @@ -44,7 +46,7 @@ use bytes; # Larry can take Unicode and shove it up his ass sideways. # errors about UTF-8 all over the place without this. my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.27 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.29 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; @@ -104,18 +106,19 @@ my $stat_count = 0; # number of files/dirs stat'ed my $skip_count_unstat = 0; # number of files skipped without stat'ing my $skip_count_stat = 0; # number of files skipped after stat -sub find_all_files { +sub find_all_files($); +sub find_all_files($) { my ($dir) = @_; print STDERR "$progname: + reading dir $dir/...\n" if ($verbose > 1); - local *DIR; - if (! opendir (DIR, $dir)) { + my $dd; + if (! opendir ($dd, $dir)) { print STDERR "$progname: couldn't open $dir: $!\n" if ($verbose); return; } - my @files = readdir (DIR); - closedir (DIR); + my @files = readdir ($dd); + closedir ($dd); my @dirs = (); @@ -190,7 +193,7 @@ sub find_all_files { } -sub spotlight_all_files { +sub spotlight_all_files($) { my ($dir) = @_; my @terms = (); @@ -220,7 +223,7 @@ sub spotlight_all_files { # running at once, one will wait for the other, instead of both of # them spanking the same file system at the same time. # -local *CACHE_FILE; +my $cache_fd = undef; my $cache_file_name = undef; my $read_cache_p = 0; @@ -242,18 +245,18 @@ sub read_cache($) { if ($verbose > 1); my $file = $cache_file_name; - open (CACHE_FILE, "+>>$file") || error ("unable to write $file: $!"); - flock (CACHE_FILE, LOCK_EX) || error ("unable to lock $file: $!"); - seek (CACHE_FILE, 0, 0) || error ("unable to rewind $file: $!"); + open ($cache_fd, '+>>', $file) || error ("unable to write $file: $!"); + flock ($cache_fd, LOCK_EX) || error ("unable to lock $file: $!"); + seek ($cache_fd, 0, 0) || error ("unable to rewind $file: $!"); - my $mtime = (stat(CACHE_FILE))[9]; + my $mtime = (stat($cache_fd))[9]; if ($mtime + $cache_max_age < time) { print STDERR "$progname: cache is too old\n" if ($verbose); return (); } - my $odir = ; + my $odir = <$cache_fd>; $odir =~ s/[\r\n]+$//s if defined ($odir); if (!defined ($odir) || ($dir ne $odir)) { print STDERR "$progname: cache is for $odir, not $dir\n" @@ -262,7 +265,7 @@ sub read_cache($) { } my @files = (); - while () { + while (<$cache_fd>) { s/[\r\n]+$//s; push @files, "$odir/$_"; } @@ -285,18 +288,17 @@ sub write_cache($) { if (! $read_cache_p) { - truncate (CACHE_FILE, 0) || + truncate ($cache_fd, 0) || error ("unable to truncate $cache_file_name: $!"); - seek (CACHE_FILE, 0, 0) || + seek ($cache_fd, 0, 0) || error ("unable to rewind $cache_file_name: $!"); if ($#all_files >= 0) { - print CACHE_FILE "$dir\n"; - my $re = qr/$dir/; + print $cache_fd "$dir\n"; foreach (@all_files) { my $f = $_; # stupid Perl. do this to avoid modifying @all_files! - $f =~ s@^$re/@@so || die; - print CACHE_FILE "$f\n"; + $f =~ s@^\Q$dir\L/@@so || die; # remove $dir from front + print $cache_fd "$f\n"; } } @@ -304,17 +306,16 @@ sub write_cache($) { if ($verbose); } - flock (CACHE_FILE, LOCK_UN) || + flock ($cache_fd, LOCK_UN) || error ("unable to unlock $cache_file_name: $!"); - close (CACHE_FILE); + close ($cache_fd); + $cache_fd = undef; } sub find_random_file($) { my ($dir) = @_; - $dir =~ s@/+$@@g; - if ($use_spotlight_p == -1) { $use_spotlight_p = 0; if (-x '/usr/bin/mdfind') { @@ -349,7 +350,7 @@ sub find_random_file($) { write_cache ($dir); - @all_files = sort(@all_files); +# @all_files = sort(@all_files); if ($#all_files < 0) { print STDERR "$progname: no files in $dir\n"; @@ -362,6 +363,7 @@ sub find_random_file($) { my $n = int (rand ($#all_files + 1)); my $file = $all_files[$n]; if (large_enough_p ($file)) { + $file =~ s@^\Q$dir\L/@@so || die; # remove $dir from front return $file; } } @@ -372,7 +374,7 @@ sub find_random_file($) { } -sub large_enough_p { +sub large_enough_p($) { my ($file) = @_; my ($w, $h) = image_file_size ($file); @@ -399,7 +401,7 @@ sub large_enough_p { # Given the raw body of a GIF document, returns the dimensions of the image. # -sub gif_size { +sub gif_size($) { my ($body) = @_; my $type = substr($body, 0, 6); my $s; @@ -411,7 +413,7 @@ sub gif_size { # Given the raw body of a JPEG document, returns the dimensions of the image. # -sub jpeg_size { +sub jpeg_size($) { my ($body) = @_; my $i = 0; my $L = length($body); @@ -462,7 +464,7 @@ sub jpeg_size { # Given the raw body of a PNG document, returns the dimensions of the image. # -sub png_size { +sub png_size($) { my ($body) = @_; return () unless ($body =~ m/^\211PNG\r/s); my ($bits) = ($body =~ m/^.{12}(.{12})/s); @@ -476,7 +478,7 @@ sub png_size { # Given the raw body of a GIF, JPEG, or PNG document, returns the dimensions # of the image. # -sub image_size { +sub image_size($) { my ($body) = @_; return () if (length($body) < 10); my ($w, $h) = gif_size ($body); @@ -489,17 +491,17 @@ sub image_size { # Returns the dimensions of the image file. # -sub image_file_size { +sub image_file_size($) { my ($file) = @_; - local *IN; - if (! open (IN, "<$file")) { + my $in; + if (! open ($in, '<', $file)) { print STDERR "$progname: $file: $!\n" if ($verbose); return undef; } - binmode (IN); # Larry can take Unicode and shove it up his ass sideways. + binmode ($in); # Larry can take Unicode and shove it up his ass sideways. my $body = ''; - sysread (IN, $body, 1024 * 50); # The first 50k should be enough. - close IN; # (It's not for certain huge jpegs... + sysread ($in, $body, 1024 * 50); # The first 50k should be enough. + close $in; # (It's not for certain huge jpegs... return image_size ($body); # but we know they're huge!) } @@ -510,7 +512,7 @@ sub error($) { exit 1; } -sub usage { +sub usage() { print STDERR "usage: $progname [--verbose] directory\n" . " Prints the name of a randomly-selected image file. The directory\n" . " is searched recursively. Images smaller than " . @@ -518,7 +520,7 @@ sub usage { exit 1; } -sub main { +sub main() { my $dir = undef; while ($_ = $ARGV[0]) { @@ -538,6 +540,7 @@ sub main { usage unless (defined($dir)); $dir =~ s@^~/@$ENV{HOME}/@s; # allow literal "~/" + $dir =~ s@/+$@@s; # omit trailing / if (! -d $dir) { print STDERR "$progname: $dir: not a directory\n"; diff --git a/driver/xscreensaver-getimage-video b/driver/xscreensaver-getimage-video index 6afd7611..6383bd85 100755 --- a/driver/xscreensaver-getimage-video +++ b/driver/xscreensaver-getimage-video @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright © 2001-2010 Jamie Zawinski . +# Copyright © 2001-2011 Jamie Zawinski . # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that @@ -18,9 +18,10 @@ # "jigsaw", etc.) get the image to manipulate by running the # "xscreensaver-getimage" program. # -# "xscreensaver-getimage" will invoke this program, depending on the -# value of the "grabVideoFrames" setting in the ~/.xscreensaver file -# (or in /usr/lib/X11/app-defaults/XScreenSaver). +# The various screen savers invoke "xscreensaver-getimage", which will in +# turn invoke this program, depending on the value of the "grabVideoFrames" +# setting in the ~/.xscreensaver file (or in the app-defaults file, usually +# /usr/lib/X11/app-defaults/XScreenSaver). # # Created: 13-Apr-2001. @@ -29,7 +30,7 @@ require 5; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.19 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.21 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $tmpdir = $ENV{TMPDIR} || "/tmp"; my $tmpfile = sprintf("%s/xssv.%08x.ppm", $tmpdir, rand(0xFFFFFFFF)); @@ -70,8 +71,10 @@ my @programs = ( "vidtomem -f $tmpfile 2>&- " . # Silicon Graphics "&& mv $tmpfile-00000.rgb $tmpfile", - # "mplayer tv:// -vo pnm -frames 1 2>&- " . # Maybe works with some cams? + # "mplayer -really-quiet tv://0 " . # Maybe works with some cams? + # "-ao null -vo pnm -frames 1 2>&- " . # "&& mv 00000001.ppm $tmpfile", + ); @@ -120,21 +123,21 @@ sub grab_image() { print STDOUT "$tmpfile\n"; } elsif ($use_stdout_p) { - local *IN; my $ppm = ""; my $reader = "<$tmpfile"; # horrid kludge for SGIs, since they don't use PPM... if ($cmd =~ m/^vidtomem\s/) { - $reader = "sgitopnm $tmpfile"; + $reader = "sgitopnm $tmpfile"; $reader .= " 2>/dev/null" if ($verbose <= 1); $reader .= " |"; } - open(IN, $reader) || error ("reading $tmpfile: $!"); + open (my $in, $reader) || error ("reading $tmpfile: $!"); print STDERR "$progname: reading $tmpfile\n" if ($verbose > 1); - while () { $ppm .= $_; } - close IN; + local $/ = undef; # read entire file + $ppm = <$in>; + close $in; unlink $tmpfile; print STDOUT $ppm; diff --git a/driver/xscreensaver-getimage.c b/driver/xscreensaver-getimage.c index 856e05a6..d7c15087 100644 --- a/driver/xscreensaver-getimage.c +++ b/driver/xscreensaver-getimage.c @@ -66,8 +66,11 @@ #ifdef __APPLE__ - /* On MacOSX / XDarwin, the usual X11 mechanism of getting a screen shot - doesn't work, and we need to use an external program. */ + /* On MacOS under X11, the usual X11 mechanism of getting a screen shot + doesn't work, and we need to use an external program. This is only + used when running under X11 on MacOS. If it's a Cocoa build, this + path is not taken, and OSX/osxgrabscreen.m is used instead. + */ # define USE_EXTERNAL_SCREEN_GRABBER #endif @@ -494,6 +497,8 @@ read_file_gdk (Screen *screen, Window window, Drawable drawable, /* Allocates a colormap that makes a PseudoColor or DirectColor visual behave like a TrueColor visual of the same depth. + + #### Duplicated in utils/grabscreen.c */ static void allocate_cubic_colormap (Screen *screen, Visual *visual, Colormap cmap, @@ -560,6 +565,8 @@ allocate_cubic_colormap (Screen *screen, Visual *visual, Colormap cmap, /* Find the pixel index that is closest to the given color (using linear distance in RGB space -- which is far from the best way.) + + #### Duplicated in utils/grabscreen.c */ static unsigned long find_closest_pixel (XColor *colors, int ncolors, @@ -600,6 +607,8 @@ find_closest_pixel (XColor *colors, int ncolors, displayable with the given X colormap. The farther from a perfect color cube the contents of the colormap are, the lossier the transformation will be. No dithering is done. + + #### Duplicated in utils/grabscreen.c */ static void remap_image (Screen *screen, Colormap cmap, XImage *image, Bool verbose_p) @@ -1119,7 +1128,7 @@ display_file (Screen *screen, Window window, Drawable drawable, /* Invokes a sub-process and returns its output (presumably, a file to load.) Free the string when done. 'grab_type' controls which program - to run. + to run. Returned pathname may be relative to 'directory', or absolute. */ static char * get_filename_1 (Screen *screen, const char *directory, grab_type type, @@ -1129,7 +1138,7 @@ get_filename_1 (Screen *screen, const char *directory, grab_type type, pid_t forked; int fds [2]; int in, out; - char buf[1024]; + char buf[10240]; char *av[20]; int ac = 0; @@ -1214,6 +1223,7 @@ get_filename_1 (Screen *screen, const char *directory, grab_type type, int wait_status = 0; FILE *f = fdopen (in, "r"); int L; + char *ret = 0; close (out); /* don't need this one */ *buf = 0; @@ -1230,14 +1240,28 @@ get_filename_1 (Screen *screen, const char *directory, grab_type type, if (!*buf) return 0; + + ret = strdup (buf); + + if (*ret != '/') + { + /* Program returned path relative to directory. Prepend dir + to buf so that we can properly stat it. */ + strcpy (buf, directory); + if (directory[strlen(directory)-1] != '/') + strcat (buf, "/"); + strcat (buf, ret); + } + if (stat(buf, &st)) { fprintf (stderr, "%s: file does not exist: \"%s\"\n", progname, buf); + free (ret); return 0; } else - return strdup (buf); + return ret; } } @@ -1487,6 +1511,7 @@ get_image (Screen *screen, grab_type which = GRAB_BARS; struct stat st; const char *file_prop = 0; + char *absfile = 0; XRectangle geom = { 0, 0, 0, 0 }; if (! drawable_window_p (dpy, window)) @@ -1572,7 +1597,8 @@ get_image (Screen *screen, We cannot grab desktop images that way if: - the window is a non-top-level window. - Using the MacOS X way, desktops are just like loaded image files. + Under X11 on MacOS, desktops are just like loaded image files. + Under Cocoa on MacOS, this code is not used at all. */ # ifndef USE_EXTERNAL_SCREEN_GRABBER if (desk_p) @@ -1650,7 +1676,18 @@ get_image (Screen *screen, break; case GRAB_FILE: - if (! display_file (screen, window, drawable, file, verbose_p, &geom)) + if (*file && *file != '/') /* pathname is relative to dir. */ + { + if (absfile) free (absfile); + absfile = malloc (strlen(dir) + strlen(file) + 10); + strcpy (absfile, dir); + if (dir[strlen(dir)-1] != '/') + strcat (absfile, "/"); + strcat (absfile, file); + } + if (! display_file (screen, window, drawable, + (absfile ? absfile : file), + verbose_p, &geom)) goto COLORBARS; file_prop = file; break; @@ -1686,6 +1723,7 @@ get_image (Screen *screen, XDeleteProperty (dpy, window, a); } + if (absfile) free (absfile); XSync (dpy, False); } diff --git a/driver/xscreensaver-text b/driver/xscreensaver-text index 24149408..1dcec8f8 100755 --- a/driver/xscreensaver-text +++ b/driver/xscreensaver-text @@ -30,7 +30,7 @@ use Text::Wrap qw(wrap); use bytes; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.22 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.23 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 0; my $http_proxy = undef; @@ -915,7 +915,7 @@ sub main() { # to read a small number of bytes, and continue reading until they # reached EOF. This is no longer possible. # - # Note that the current MacOS behavior has all three of these + # Note that the current MacOS behavior has all four of these # awesome properties: 1) Inconvenient; 2) Has no sane workaround; # 3) Different behavior than MacOS 10.1 through 10.4; and 4) # Different behavior than every other Unix in the world. diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c index 70bb9542..2fdc4ac6 100644 --- a/driver/xscreensaver.c +++ b/driver/xscreensaver.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 1991-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -1227,6 +1227,11 @@ main_loop (saver_info *si) for (i = 0; i < si->nscreens; i++) spawn_screenhack (&si->screens[i]); + /* If we are blanking only, we might as well power down the monitor + right now, regardless of what the DPMS settings are. */ + if (p->mode == BLANK_ONLY) + monitor_power_on (si, False); + /* Don't start the cycle timer in demo mode. */ if (!si->demoing_p && p->cycle) si->cycle_id = XtAppAddTimeOut (si->app, @@ -1382,6 +1387,15 @@ main (int argc, char **argv) struct passwd *spasswd; int i; + /* It turns out that if we do NLS stuff here, people running in Japanese + locales get font craziness on the password dialog, presumably because + it is displaying Japanese characters in a non-Japanese font. I don't + understand how to automatically make all this crap work properly by + default, so until someone sends me a better patch, just leave it off + and run the daemon in English. -- jwz, 29-Sep-2010 + */ +#undef ENABLE_NLS + #ifdef ENABLE_NLS if (!setlocale (LC_ALL, "")) fprintf (stderr, "locale not supported by C library\n"); diff --git a/driver/xscreensaver.h b/driver/xscreensaver.h index 29b9ebd1..26d9fcd3 100644 --- a/driver/xscreensaver.h +++ b/driver/xscreensaver.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-2011 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -53,7 +53,7 @@ extern void init_xinput_extension (saver_info *si); /* Display Power Management System (DPMS) interface. */ extern Bool monitor_powered_on_p (saver_info *si); -extern void monitor_power_on (saver_info *si); +extern void monitor_power_on (saver_info *si, Bool on_p); /* ======================================================================= diff --git a/driver/xscreensaver.man b/driver/xscreensaver.man index dba7dfda..0146042a 100644 --- a/driver/xscreensaver.man +++ b/driver/xscreensaver.man @@ -811,34 +811,6 @@ seconds before selecting events on existing windows, under the assumption that \fIxscreensaver\fP is started during your login procedure, and the window state may be in flux. Default 0. (This used to default to 30, but that was back in the days when slow machines and X terminals were more common...) -.RE -.PP -There are a number of different X server extensions which can make -xscreensaver's job easier. The next few resources specify whether these -extensions should be utilized if they are available. -.TP 8 -.B sgiSaverExtension\fP (class \fBBoolean\fP) -This resource controls whether the SGI \fBSCREEN_SAVER\fP server extension -will be used to decide whether the user is idle. This is the default -if \fIxscreensaver\fP has been compiled with support for this -extension (which is the default on SGI systems.). If it is available, -the \fBSCREEN_SAVER\fP method is faster and more reliable than what will -be done otherwise, so use it if you can. (This extension is only available -on Silicon Graphics systems, unfortunately.) -.TP 8 -.B mitSaverExtension\fP (class \fBBoolean\fP) -This resource controls whether the \fBMIT\-SCREEN\-SAVER\fP server extension -will be used to decide whether the user is idle. However, the default for -this resource is \fIfalse\fP, because even if this extension is available, -it is flaky (and it also makes the \fBfade\fP option not work properly.) -Use of this extension is strongly discouraged. Support for it will -probably be removed eventually. -.TP 8 -.B xidleExtension\fP (class \fBBoolean\fP) -This resource controls whether the \fBXIDLE\fP server extension will be -used to decide whether the user is idle. This is the default -if \fIxscreensaver\fP has been compiled with support for this extension. -(This extension is only available for X11R4 and X11R5 systems, unfortunately.) .TP 8 .B procInterrupts\fP (class \fBBoolean\fP) This resource controls whether the \fB/proc/interrupts\fP file should be @@ -915,8 +887,7 @@ and a FAQ can always be found at http://www.jwz.org/xscreensaver/ .BR xscreensaver\-getimage (1), .BR xscreensaver\-text (1). .SH COPYRIGHT -Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by Jamie Zawinski. +Copyright \(co 1991-2011 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that @@ -929,22 +900,7 @@ Jamie Zawinski . Written in late 1991; version 1.0 posted to comp.sources.x on 17-Aug-1992. Please let me know if you find any bugs or make any improvements. -.SH ACKNOWLEDGEMENTS -Thanks to Angela Goodman for the XScreenSaver logo. - -Thanks to the many people who have contributed graphics demos to the package. - -Thanks to David Wojtowicz for implementing \fIlockTimeout\fP. - -Thanks to Martin Kraemer for adding support for shadow passwords and -locking-disabled diagnostics. - -Thanks to Patrick Moreau for the VMS port. - -Thanks to Nat Lanza for the Kerberos support. - -Thanks to Bill Nottingham for the initial PAM support. -And thanks to Jon A. Christopher for implementing the Athena dialog -support, back in the days before Lesstif or Gtk were viable alternatives -to Motif. +And a huge thank you to the hundreds of people who have contributed, in +large ways and small, to the xscreensaver collection over the past +two decades! diff --git a/driver/xset.c b/driver/xset.c index 46607977..5ad95a78 100644 --- a/driver/xset.c +++ b/driver/xset.c @@ -99,20 +99,8 @@ Bool query_xinput_extension (saver_info *si) { XExtCodes codes; - - if (!XQueryExtension (si->dpy, INAME, &codes.major_opcode, - &codes.first_event, &codes.first_error)) - { - if (si->prefs.verbose_p) - fprintf (stderr, "\t XInputExtension is not present!\n"); - return False; - } - else - { - if (si->prefs.verbose_p) - fprintf (stderr, "\t XInputExtension is present!\n"); - return True; - } + return XQueryExtension (si->dpy, INAME, &codes.major_opcode, + &codes.first_event, &codes.first_error); } void diff --git a/hacks/._barcode.c b/hacks/._barcode.c index 8d484479..53b1e66f 100644 Binary files a/hacks/._barcode.c and b/hacks/._barcode.c differ diff --git a/hacks/._celtic.c b/hacks/._celtic.c index 797e674f..29227ffb 100644 Binary files a/hacks/._celtic.c and b/hacks/._celtic.c differ diff --git a/hacks/._demon.c b/hacks/._demon.c index 1433347c..b3d39ab6 100644 Binary files a/hacks/._demon.c and b/hacks/._demon.c differ diff --git a/hacks/._eruption.c b/hacks/._eruption.c index dfdbea5d..33ea838a 100644 Binary files a/hacks/._eruption.c and b/hacks/._eruption.c differ diff --git a/hacks/._flow.c b/hacks/._flow.c index 3081c8e3..cd82dc23 100644 Binary files a/hacks/._flow.c and b/hacks/._flow.c differ diff --git a/hacks/._interaggregate.c b/hacks/._interaggregate.c index 51c19b88..079d05a7 100644 Binary files a/hacks/._interaggregate.c and b/hacks/._interaggregate.c differ diff --git a/hacks/._noseguy.c b/hacks/._noseguy.c index 82a33906..78948993 100644 Binary files a/hacks/._noseguy.c and b/hacks/._noseguy.c differ diff --git a/hacks/._petri.c b/hacks/._petri.c index 22a5a2ff..f112ec45 100644 Binary files a/hacks/._petri.c and b/hacks/._petri.c differ diff --git a/hacks/._shadebobs.c b/hacks/._shadebobs.c index e0d09f82..618cfa70 100644 Binary files a/hacks/._shadebobs.c and b/hacks/._shadebobs.c differ diff --git a/hacks/._slidescreen.c b/hacks/._slidescreen.c index 3d50a092..301c6a0c 100644 Binary files a/hacks/._slidescreen.c and b/hacks/._slidescreen.c differ diff --git a/hacks/._webcollage-helper-cocoa.m b/hacks/._webcollage-helper-cocoa.m deleted file mode 100644 index 8b7e2fae..00000000 Binary files a/hacks/._webcollage-helper-cocoa.m and /dev/null differ diff --git a/hacks/._zoom.c b/hacks/._zoom.c index 8998fefd..0992e503 100644 Binary files a/hacks/._zoom.c and b/hacks/._zoom.c differ diff --git a/hacks/Makefile.in b/hacks/Makefile.in index 5aff4a4b..5684f062 100644 --- a/hacks/Makefile.in +++ b/hacks/Makefile.in @@ -1,4 +1,4 @@ -# hacks/Makefile.in --- xscreensaver, Copyright (c) 1997-2010 Jamie Zawinski. +# hacks/Makefile.in --- xscreensaver, Copyright (c) 1997-2011 Jamie Zawinski. # the `../configure' script generates `hacks/Makefile' from this file. @SET_MAKE@ @@ -66,7 +66,7 @@ INCLUDES_1 = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. INCLUDES = $(INCLUDES_1) @INCLUDES@ UTIL_SRCS = $(UTILS_SRC)/alpha.c $(UTILS_SRC)/colors.c \ - $(UTILS_SRC)/grabscreen.c $(UTILS_SRC)/grabclient.c \ + $(UTILS_SRC)/grabclient.c \ $(UTILS_SRC)/hsv.c $(UTILS_SRC)/resources.c \ $(UTILS_SRC)/spline.c $(UTILS_SRC)/usleep.c \ $(UTILS_SRC)/visual.c $(UTILS_SRC)/logo.c \ @@ -74,7 +74,7 @@ UTIL_SRCS = $(UTILS_SRC)/alpha.c $(UTILS_SRC)/colors.c \ $(UTILS_SRC)/yarandom.c $(UTILS_SRC)/erase.c \ $(UTILS_SRC)/xshm.c $(UTILS_SRC)/xdbe.c UTIL_OBJS = $(UTILS_BIN)/alpha.o $(UTILS_BIN)/colors.o \ - $(UTILS_BIN)/grabscreen.o $(UTILS_BIN)/grabclient.o \ + $(UTILS_BIN)/grabclient.o \ $(UTILS_BIN)/hsv.o $(UTILS_BIN)/resources.o \ $(UTILS_BIN)/spline.o $(UTILS_BIN)/usleep.o \ $(UTILS_BIN)/visual.o $(UTILS_BIN)/logo.o \ @@ -118,7 +118,7 @@ SCRIPTS = vidwhacker webcollage ljlatest # Programs that are mentioned in XScreenSaver.ad, and that have XML files, # but that are not shipped with xscreensaver itself. # -EXTERNALS = cosmos electricsheep extrusion fireflies goban \ +EXTERNALS = cosmos electricsheep fireflies goban \ sphereeversion ssystem xaos xdaliclock xearth xfishtank \ xmountains xplanet xsnow @@ -276,7 +276,7 @@ install-program:: $(EXES) $(install_prefix)$(HACKDIR)/$$program ; \ $(INSTALL_PROGRAM) $$program \ $(install_prefix)$(HACKDIR)/$$program ; \ - done ; \ + done install-scripts: $(SCRIPTS) munge-scripts @for program in $(SCRIPTS); do \ diff --git a/hacks/apple2.c b/hacks/apple2.c index 8e7cf41d..d50fb015 100644 --- a/hacks/apple2.c +++ b/hacks/apple2.c @@ -671,11 +671,12 @@ apple2_one_frame (apple2_sim_t *sim) int c; /* If we're in the midst of typing a string, emit a character with random timing. */ - c =*sim->typing++; + c =*sim->typing; if (c==0) { sim->typing=NULL; } else { + sim->typing++; a2_printc(sim->st, c); if (c=='\r' || c=='\n') { sim->next_actiontime = sim->curtime; diff --git a/hacks/asm6502.c b/hacks/asm6502.c index af0a9341..a893b659 100644 --- a/hacks/asm6502.c +++ b/hacks/asm6502.c @@ -95,11 +95,11 @@ typedef struct { } Pointer; -static void *emalloc(size_t n) { +/*static void *emalloc(size_t n) { void *p = malloc(n); if (! p) abort(); return p; -} +}*/ static void *ecalloc(uint32_t nelm, size_t nsize){ void *p = calloc(nelm, nsize); @@ -1130,7 +1130,7 @@ static Param *newParam(void){ Param *newp; int i = 0; - newp = (Param *) emalloc(sizeof(Param)); + newp = (Param *) ecalloc(1, sizeof(Param)); newp->type = SINGLE; for (i = 0; i < MAX_PARAM_VALUE; i++) newp->value[i] = 0; @@ -1153,7 +1153,7 @@ static void copyParam(Param *p1, Param *p2){ static Label *newLabel(void){ Label *newp; - newp = (Label *) emalloc(sizeof(Label)); + newp = (Label *) ecalloc(1, sizeof(Label)); newp->addr = 0; newp->label = ecalloc(MAX_LABEL_LEN,sizeof(char)); @@ -1164,7 +1164,7 @@ static AsmLine *newAsmLine(char *cmd, char *label, BOOL decl, Param *param, int { AsmLine *newp; - newp = (AsmLine *) emalloc(sizeof(AsmLine)); + newp = (AsmLine *) ecalloc(1, sizeof(AsmLine)); newp->labelDecl = decl; newp->label = newLabel(); strncpy(newp->label->label,label,MAX_LABEL_LEN); @@ -2091,7 +2091,7 @@ static void execute(machine_6502 *machine){ machine_6502 *build6502(){ machine_6502 *machine; - machine = emalloc(sizeof(machine_6502)); + machine = ecalloc(1, sizeof(machine_6502)); assignOpCodes(machine->opcodes); buildIndexCache(machine); reset(machine); diff --git a/hacks/config/._klein.xml b/hacks/config/._klein.xml index d71054ad..5f88d0df 100644 Binary files a/hacks/config/._klein.xml and b/hacks/config/._klein.xml differ diff --git a/hacks/config/README b/hacks/config/README index 6f210938..4313192c 100644 --- a/hacks/config/README +++ b/hacks/config/README @@ -4,8 +4,8 @@ a screen saver and locker for the X window system by Jamie Zawinski - version 5.12 - 15-Sep-2010 + version 5.13 + 18-Apr-2011 http://www.jwz.org/xscreensaver/ diff --git a/hacks/config/dnalogo.xml b/hacks/config/dnalogo.xml index dd182a31..fa74fa0f 100644 --- a/hacks/config/dnalogo.xml +++ b/hacks/config/dnalogo.xml @@ -9,17 +9,21 @@ low="0" high="100000" default="25000" convert="invert"/> + <_description> DNA Lounge + Restaurant -- Bar -- Nightclub -- Cafe -- Est. 1985. + 375 Eleventh Street San Francisco, CA - 94107 + 94103 -http://www.dnalounge.com/ + http://www.dnalounge.com/ + http://www.dnapizza.com/ Written by Jamie Zawinski; 2001. diff --git a/hacks/config/glhanoi.xml b/hacks/config/glhanoi.xml index 983321f5..94966b09 100644 --- a/hacks/config/glhanoi.xml +++ b/hacks/config/glhanoi.xml @@ -19,6 +19,10 @@ + + diff --git a/hacks/config/goop.xml b/hacks/config/goop.xml index c3a71fbd..f8b1ab48 100644 --- a/hacks/config/goop.xml +++ b/hacks/config/goop.xml @@ -42,8 +42,8 @@ diff --git a/hacks/config/kaleidescope.xml b/hacks/config/kaleidescope.xml index a819370a..e9b1b308 100644 --- a/hacks/config/kaleidescope.xml +++ b/hacks/config/kaleidescope.xml @@ -19,8 +19,7 @@ + low="1" high="1000" default="100"/> diff --git a/hacks/config/polyhedra.xml b/hacks/config/polyhedra.xml index d8d99897..e90ec04b 100644 --- a/hacks/config/polyhedra.xml +++ b/hacks/config/polyhedra.xml @@ -78,7 +78,7 @@