http://www.jwz.org/xscreensaver/xscreensaver-5.09.tar.gz
[xscreensaver] / hacks / phosphor.c
index 6f9fe9170a261d88bf174ce61a31bed7e897ee8e..7be6c03cfb27ab8a4e714029c486010e767961ae 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1999-2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1999-2009 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -1338,7 +1338,7 @@ static void
 drain_input (p_state *state)
 {
   XtAppContext app = XtDisplayToApplicationContext (state->dpy);
-  if (state->input_available_p)
+  if (state->input_available_p && state->pipe)
     {
       unsigned char s[2];
       int n = read (fileno (state->pipe), (void *) s, 1);
@@ -1354,6 +1354,7 @@ drain_input (p_state *state)
            {
              waitpid(state->pid, NULL, 0);
              fclose (state->pipe);
+              state->pid = 0;
            }
          else
            {
@@ -1436,7 +1437,7 @@ phosphor_reshape (Display *dpy, Window window, void *closure,
   resize_grid (state);
 
 # if defined(HAVE_FORKPTY) && defined(TIOCSWINSZ)
-  if (state->pid)
+  if (state->pid && state->pipe)
     {
       /* Tell the sub-process that the screen size has changed. */
       struct winsize ws;
@@ -1512,6 +1513,7 @@ phosphor_free (Display *dpy, Window window, void *closure)
 static const char *phosphor_defaults [] = {
   ".background:                   Black",
   ".foreground:                   #00FF00",
+  "*fpsSolid:             true",
   "*fadeForeground:       #006400",
   "*flareForeground:      #FFFFFF",
 #if defined(BUILTIN_FONT)