Wednesday, June 18, 2008

Messing with X11

My latest foray into X windowing got me stuck in a couple places. I'll give a brief overview today of my issues and resolutions, and perhaps if I find some time I'll go through in more detail later.

Issue: Finding a call to locate the focused window.
Resolution: XGetInputFocus

Issue: Finding a call to get the window title.
Resolution1: XGetWindowProperty
Resolution2: XFetchName (much much easier)

Issue: Window title is null?
Reason: There appears to be an invisible window overlayed on it. Often "FocusProxy".
Resolution: XQueryTree to find the parent. This resolution is iffy.

Issue: Finding a call to get a process ID from a window.
Resolution: XGetWindowProperty -> _NET_WM_PID (though it's not always set)

No comments: