genxproj - embedding on X
An X11 application can be embedded in a window of another X11 application
using various methods, such as XEmbed or running a pseudo X server within
the window. The former needs applications to be prepared for embedding,
thus can not be used with genxproj. Running an extra X server, such as xnest
or xypher may be a resource-hungry operation.
Therefor genxproj chosen a third method: code injection using LD_PRELOAD.
The injected code is a tiny dynamic lib that hooks the X11 function call
for creating windows. Most calls are relayed to the real Xlib functions
transparently, except:
- the call parameters of the top window of the application is modified so that the parent window is the widget window genxproj provides
- all top level window IDs are reported to genxproj so it can keep track on windows belonging to the application
In a sense genxproj is similar to a window manager: it places and sizes
the main window of applications and manages hiding/showing the popup
windows as well. However, it can not be implemented as a real window manager:
that would suppress the user's preferred window manager.