+ XtAppNextEvent (si->app, &event.x_event);
+
+#ifdef HAVE_RANDR
+ if (si->using_randr_extension &&
+ (event.x_event.type ==
+ (si->randr_event_number + RRScreenChangeNotify)))
+ {
+ /* The Resize and Rotate extension sends an event when the
+ size, rotation, or refresh rate of any screen has changed. */
+
+ if (p->verbose_p)
+ {
+ /* XRRRootToScreen is in Xrandr.h 1.4, 2001/06/07 */
+ int screen = XRRRootToScreen(si->dpy, event.xrr_event.window);
+ fprintf (stderr, "%s: %d: screen change event received\n",
+ blurb(), screen);
+ }
+
+#ifdef RRScreenChangeNotifyMask
+ /* Inform Xlib that it's ok to update its data structures. */
+ XRRUpdateConfiguration(&event.x_event); /* Xrandr.h 1.9, 2002/09/29*/
+#endif /* RRScreenChangeNotifyMask */
+
+ /* Resize the existing xscreensaver windows and cached ssi data. */
+ if (update_screen_layout (si))
+ {
+ if (p->verbose_p)
+ {
+ fprintf (stderr, "%s: new layout:\n", blurb());
+ describe_monitor_layout (si);
+ }
+ resize_screensaver_window (si);
+ }
+ }
+ else
+#endif /* HAVE_RANDR */
+
+ if (event.x_event.xany.window == si->passwd_dialog &&
+ event.x_event.xany.type == Expose)