summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2010-01-16 19:09:28 +0100
committerSung-Jin Park <sj76.park@samsung.com>2013-09-02 23:32:30 -0400
commit8a82f0edaa4e2ef5823f317e305d2d5c9a34f75f (patch)
treed85c0a1ab6f458509be26f34305f26fb9e97c768
parent800db16cba338229901097d86e519d82e28ac62b (diff)
downloadxev-8a82f0edaa4e2ef5823f317e305d2d5c9a34f75f.tar.gz
xev-8a82f0edaa4e2ef5823f317e305d2d5c9a34f75f.tar.bz2
xev-8a82f0edaa4e2ef5823f317e305d2d5c9a34f75f.zip
Add -root option to specify monitoring root window events.
Change-Id: I4189cf1aaf34c7fc84a922220491f1eaefdcd5b4 Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--xev.c18
-rw-r--r--xev.man6
2 files changed, 21 insertions, 3 deletions
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)
diff --git a/xev.man b/xev.man
index dcb1e3a..136a01a 100644
--- a/xev.man
+++ b/xev.man
@@ -9,7 +9,7 @@ xev - print contents of X events
.B "xev"
[\-display \fIdisplayname\fP] [\-geometry \fIgeom\fP]
[\-bw \fIpixels\fP] [\-bs \fI{NotUseful,WhenMapped,Always}\fP]
-[\-id \fIwindowid\fP] [\-s] [\-name \fIstring\fP] [\-rv]
+[\-id \fIwindowid\fP] [\-root] [\-s] [\-name \fIstring\fP] [\-rv]
.SH DESCRIPTION
.PP
\fIXev\fP creates a window and then asks the X server to send it
@@ -40,6 +40,10 @@ means that the xev process will redraw its contents itself, as necessary.
This option specifies that the window with the given id should be
monitored, instead of creating a new window.
.TP 8
+.B \-root
+This option specifies that the root window should be
+monitored, instead of creating a new window.
+.TP 8
.B \-s
This option specifies that save-unders should be enabled on the window. Save
unders are similar to backing store, but they refer rather to the saving of