-#ifdef DEBUG_TIMERS
- if (p->verbose_p)
- if (root_x == ssi->poll_mouse_last_root_x &&
- root_y == ssi->poll_mouse_last_root_y &&
- child == ssi->poll_mouse_last_child)
- fprintf (stderr, "%s: modifiers changed at %s on screen %d.\n",
- blurb(), timestring(), i);
- else
- fprintf (stderr, "%s: pointer moved at %s on screen %d.\n",
- blurb(), timestring(), i);
-#endif /* DEBUG_TIMERS */
+ if (p->debug_p)
+ {
+ if (root_x == ssi->poll_mouse_last_root_x &&
+ root_y == ssi->poll_mouse_last_root_y &&
+ child == ssi->poll_mouse_last_child)
+ fprintf (stderr, "%s: %d: modifiers changed: 0x%04x -> 0x%04x.\n",
+ blurb(), i, ssi->poll_mouse_last_mask, mask);
+ else
+ {
+ fprintf (stderr, "%s: %d: pointer moved: ", blurb(), i);
+ if (ssi->poll_mouse_last_root_x == -1)
+ fprintf (stderr, "off screen");
+ else
+ fprintf (stderr, "%d,%d",
+ ssi->poll_mouse_last_root_x,
+ ssi->poll_mouse_last_root_y);
+ fprintf (stderr, " -> ");
+ if (root_x == -1)
+ fprintf (stderr, "off screen.");
+ else
+ fprintf (stderr, "%d,%d", root_x, root_y);
+ if (ssi->poll_mouse_last_root_x == -1 || root_x == -1)
+ fprintf (stderr, ".\n");
+ else
+# undef ABS
+# define ABS(x)((x)<0?-(x):(x))
+ fprintf (stderr, " (%d,%d).\n",
+ ABS(ssi->poll_mouse_last_root_x - root_x),
+ ABS(ssi->poll_mouse_last_root_y - root_y));
+# undef ABS
+ }
+ }