C++/Shell Integration
Eirik Byrkjeflot Anonsen
eirik at opera.com
Mon May 17 23:06:45 PDT 2010
Dirk Wallenstein <halsmit at t-online.de> writes:
> On Sat, May 15, 2010 at 11:41:45PM +0100, Mubarak Aguye wrote:
>> Hi. I was wondering if there is a way of determining the title of the
>> current active window, and its x-y coordinates from within a C++
>> application, or even a standard Linux shell.
>
> For the shell, you could use 'xwininfo'.
> For C++, you would use XWindowAttributes and Properties.
> http://www.x.org/docs/X11/xlib.pdf (Chapter 3)
> http://tronche.com/gui/x/xlib/window-information/
And "the currently active window", assuming you mean the window that is
currently set up to receive key events from the primary keyboard, is
probably the window you get from XGetInputFocus(). (If you mean
something else by "currently active window", you'll probably have to ask
your window manager somehow.)
eirik
More information about the xorg
mailing list