Wednesday, June 11, 2008

X System Calls

Lately I've been searching for a couple calls under X that have been evading me. The one in particular that I need is a call to determine the process ID of the foreground window.

I've found some very interesting info, lots of stuff that would be useful if I were implementing a complete window manager:

Inter-client Communication Conventions Manual
Window ID -> Process ID
Wikipedia's Xlib Article

I have a feeling that what I need is in Xlib, but I haven't had time to go through it completely yet.

What worries me, though, is that I've read a couple places that going from window ID to process ID is (almost?) nondeterministic in X. There HAS to be a way though... right? I just don't know enough about window managers and X I guess.

Edit/Update:

This:

Xlib Programming Manual: Input Focus Events

has some potential for helping.

XGetInputFocus

Promising!

"A C++ program to generate every possible X11 request"

Very useful.

No comments: