Subject: FVWM: Xlib questions

From: Ludovic Drolez <[email-masked]>
Date: Thu, 15 Oct 1998 13:03:12 +0000

Hi Xlib/Xprotocol hackers !

    I am currently trying to write an X11 client that send (with
XHi Xlib/Xprotocol hackers !SendEvent) fake X11 events (MotionEvent,
ButtonPress, KeyPress),
to control the pointer and the keyboard from an X client.
    But I have a problem: XSendEvent needs a target window ID.

    So, I try to get the window's id of the window under the pointer.
Currently, I use some code taken from `xwininfo' to get the whole tree
of
X11 windows (with XGetTree) and the geometry of each window to check
if the pointer is in. But that crazy way of finding the window id, do
not work when several windows are mapped at the same location since,
I do not know which window is on top.

    To solve the problem, I have two questions:

    - Is there a way to find the current visible window ?
    - Or, is there a much simpler Xlib call that can give
    me the window id under the cursor, since the X server
    always knows the current window id.

Thanks.

    Ludovic Drolez. (please reply by mail)

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Carl R. Witty)
Date: 15 Oct 1998 13:08:08 -0700

>     But I have a problem: XSendEvent needs a target window ID.

Instead of giving it a real window ID, you can pass the magic value
PointerWindow, which does exactly what you want.  (Search the
XSendEvent man page for "PointerWindow".)

Carl Witty
[email-masked]