Simple application to get window WId ?

Eirik Byrkjeflot Anonsen eirik at
Sun Aug 22 22:42:32 PDT 2010

Aaron Lewis <aaron.lewis1989 at> writes:

> Hi,
> 	I'm currently working on a KDE application , plasma-globalmenu , which
> will make all GTK / Gnome application globally on XBar , but now i'm
> meeting a problem , so i need to write a simply application , which
> could help me detect the WId of a running window.
> Like , popup a mouse , let me click on something , and print a unique
> number (WId) , in decimal or hex , doesn't matter.
> Could anyone give a hand on this simple application ?

It sounds like you want xwininfo.

> I think it's very basic , but i've never done pure X11 programming
> before , any guides is appreciated.

If you want to code it yourself, both xwininfo and xprop do this, so you
could look at how they do it.

(It is probably a little harder than you might think, as you probably
want the XID of the "application" window, and not any random subwindow
or the root window or a window created by the window manager...)


More information about the xorg mailing list