[comp.windows.x] Xlib: grabbing events by another program ?

devil@diablery.10A.com (Gil Tene) (05/28/91)

Hello Xfolk,

I am trying to grab button events on an already opened window by
a seperate program. The "already opened window" is run under some
closed application that I cannot play around with too much, and the
"seperate program" needs to know the x,y of clicks on the window. 
The way I find the proper window XID is by searching the window list 
for the proper window name.

using : XSelectInput(d, w, ButtonPressMask|ButtonReleaseMask);

seems to work only on windows for which no other program has
grabbed the button events yet. If I run this program once on
such windows all works well, but if I two copies of it at the
same time, on the same window, it breaks down, denying access
to "private resource". I assume this is because two programs 
cannot "subscribe" to the same button events (right?). The problem
is that the closed application seems to be "subscribed" to these
events, even though it doesn't need them...

Is there any way for me to delete the existing program's 
"subscription" to these events, and replace them with my
own?

AdvThanks,

-- Gil.
-- 
--------------------------------------------------------------------
-- Gil Tene			"Some days it just dosn't pay      -
-- devil@imp.HellNet.org	   to go to sleep in the morning." -
-- devil@diablery.10A.com 					   -
--------------------------------------------------------------------