From 743eb7755bb50bccffb0840af44e67a4d635d1c1 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 16 Jan 2010 19:09:28 +0100 Subject: Add -root option to specify monitoring root window events. Signed-off-by: Kim Woelders Reviewed-by: Dan Nicholson Signed-off-by: Peter Hutterer --- xev.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'xev.c') diff --git a/xev.c b/xev.c index 16d45aa..b422aa2 100644 --- a/xev.c +++ b/xev.c @@ -690,6 +690,7 @@ usage (void) " -bw pixels border width in pixels", " -bs {NotUseful,WhenMapped,Always} backingstore attribute", " -id windowid use existing window", +" -root use root window", " -s set save-unders attribute", " -name string window name", " -rv reverse video", @@ -739,6 +740,7 @@ main (int argc, char **argv) int done; char *name = "Event Tester"; Bool reverse = False; + Bool use_root = False; unsigned long back, fore; XIM xim; XIMStyles *xim_styles; @@ -793,8 +795,17 @@ main (int argc, char **argv) if (++i >= argc) usage (); name = argv[i]; continue; - case 'r': /* -rv */ - reverse = True; + case 'r': + switch (arg[2]) { + case 'o': /* -root */ + use_root = True; + continue; + case 'v': /* -rv */ + reverse = True; + continue; + default: + usage (); + } continue; case 's': /* -s */ attr.save_under = True; @@ -865,6 +876,9 @@ main (int argc, char **argv) FocusChangeMask | PropertyChangeMask | ColormapChangeMask | OwnerGrabButtonMask; + if (use_root) + w = RootWindow(dpy, screen); + if (w) { XGetWindowAttributes(dpy, w, &wattr); if (wattr.all_event_masks & ButtonPressMask) -- cgit v1.2.3