+
+#ifdef HAVE_SAVER_EXTENSION
+ if (event.type == saver_ext_event_number)
+ {
+ XScreenSaverNotifyEvent *sevent =
+ (XScreenSaverNotifyEvent *) &event;
+ if (sevent->state == ScreenSaverOn)
+ {
+# ifdef DEBUG_TIMERS
+ if (verbose_p)
+ printf ("%s: ScreenSaverOn event received at %s\n",
+ progname, timestring ());
+# endif /* DEBUG_TIMERS */
+
+ /* Get the "real" server window out of the way as soon
+ as possible. */
+ if (server_saver_window &&
+ window_exists_p (dpy, server_saver_window))
+ XUnmapWindow (dpy, server_saver_window);
+
+ if (sevent->kind != ScreenSaverExternal)
+ {
+# ifdef DEBUG_TIMERS
+ fprintf (stderr,
+ "%s: ScreenSaverOn event wasn't of type External!\n",
+ progname);
+# endif /* DEBUG_TIMERS */
+ }
+
+ if (until_idle_p)
+ goto DONE;
+ }
+ else if (sevent->state == ScreenSaverOff)
+ {
+# ifdef DEBUG_TIMERS
+ if (verbose_p)
+ printf ("%s: ScreenSaverOff event received at %s\n",
+ progname, timestring ());
+# endif /* DEBUG_TIMERS */
+ if (!until_idle_p)
+ goto DONE;
+ }
+# ifdef DEBUG_TIMERS
+ else if (verbose_p)
+ printf ("%s: unknown ScreenSaver event received at %s\n",
+ progname, timestring ());
+# endif /* DEBUG_TIMERS */
+ }
+ else
+
+#endif /* HAVE_SAVER_EXTENSION */
+
+ XtDispatchEvent (&event);