/* timers.c --- detecting when the user is idle, and other timer-related tasks.
- * xscreensaver, Copyright (c) 1991-2002 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2004 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
#include <X11/extensions/XScreenSaver.h>
#endif /* HAVE_SGI_SAVER_EXTENSION */
+#ifdef HAVE_RANDR
+#include <X11/extensions/Xrandr.h>
+#endif /* HAVE_RANDR */
+
#include "xscreensaver.h"
#ifdef HAVE_PROC_INTERRUPTS
int root_x, root_y, x, y;
unsigned int mask;
+ if (!ssi->real_screen_p) continue;
+
if (!XQueryPointer (si->dpy, ssi->screensaver_window, &root, &child,
&root_x, &root_y, &x, &y, &mask))
{
break;
fprintf (stderr,"%s: %d: %s on 0x%lx",
blurb(), i, type, (unsigned long) window);
+
+ /* Be careful never to do this unless in -debug mode, as
+ this could expose characters from the unlock password. */
+ if (p->debug_p && event.xany.type == KeyPress)
+ {
+ KeySym keysym;
+ char c = 0;
+ XLookupString (&event.xkey, &c, 1, &keysym, 0);
+ fprintf (stderr, " (%s%s)",
+ (event.xkey.send_event ? "synthetic " : ""),
+ XKeysymToString (keysym));
+ }
+
if (x == -1)
fprintf (stderr, "\n");
else
else
#endif /* HAVE_SGI_SAVER_EXTENSION */
+#ifdef HAVE_RANDR
+ if (event.type == (si->randr_event_number + RRScreenChangeNotify))
+ {
+ /* The Resize and Rotate extension sends an event when the
+ size, rotation, or refresh rate of the screen has changed. */
+
+ XRRScreenChangeNotifyEvent *xrr_event =
+ (XRRScreenChangeNotifyEvent *) &event;
+ int screen = XRRRootToScreen (si->dpy, xrr_event->window);
+
+ if (p->verbose_p)
+ {
+ if (si->screens[screen].width == xrr_event->width &&
+ si->screens[screen].height == xrr_event->height)
+ fprintf (stderr,
+ "%s: %d: no-op screen size change event (%dx%d)\n",
+ blurb(), screen,
+ xrr_event->width, xrr_event->height);
+ else
+ fprintf (stderr,
+ "%s: %d: screen size changed from %dx%d to %dx%d\n",
+ blurb(), screen,
+ si->screens[screen].width,
+ si->screens[screen].height,
+ xrr_event->width, xrr_event->height);
+ }
+
+ /* Inform Xlib that it's ok to update its data structures. */
+ XRRUpdateConfiguration (&event);
+
+ /* Resize the existing xscreensaver windows and cached ssi data. */
+ resize_screensaver_window (si);
+ }
+ else
+#endif /* HAVE_RANDR */
+
/* Just some random event. Let the Widgets handle it, if desired. */
dispatch_event (si, &event);
}
while (fgets (new_line, sizeof(new_line)-1, f1))
{
- if (!checked_kbd && strstr (new_line, "keyboard"))
+ if (strchr (new_line, ','))
+ {
+ /* Ignore any line that has a comma on it: this is because
+ a setup like this:
+
+ 12: 930935 XT-PIC usb-uhci, PS/2 Mouse
+
+ is really bad news. It *looks* like we can note mouse
+ activity from that line, but really, that interrupt gets
+ fired any time any USB device has activity! So we have
+ to ignore any shared IRQs.
+ */
+ }
+ else if (!checked_kbd && strstr (new_line, "keyboard"))
{
kbd_changed = (*last_kbd_line && !!strcmp (new_line, last_kbd_line));
strcpy (last_kbd_line, new_line);