I am using "xev" to monitor a program running under X. I use:
xev -id 0xNNNNNNNN -event mouse -event keyboard
It all works fine, except for one thing. If the window (program) exits,
the xev process continues running. I would like for xev to exit if/when
the program/window it is monitoring goes away.
It seems to me that it should - i.e., that the behavior I want should be
the default - but it isn't. I suppose it is sort of like when a program
opens up a file, then the file gets deleted; the handle (i.e.,, file
descriptor) still references the file, even though the file is now gone.
So, I suppose once xev has translated the id into some kind of "handle" to
the window, it no longer cares if that id becomes invalid.
So, first, I'd like to know if there is some easy way to make this work.
I.e., to make "xev" exit when the window goes away.
Failing that, I'd like to know what to put as the "event mask" to make it
catch the "DestroyNotify" event. I.e., I have tested, and if I don't
specify any "event mask(s)" at all, then it does generate "DestroyNotify"
when the window goes away. I would like to retain the event masking for
only mouse and keyboard and whatever else I need to add to get
DestroyNotify events reported.
--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Aspergers