[ale] Need some X11 (and toolkit) programming help

Michael Trausch mike at trausch.us
Tue Mar 29 14:04:09 EDT 2011


I'm wondering if anyone on the list is a "guru" when it comes to X11 
programming.  I'm having a very difficult time on a particular problem 
that I have been trying to solve on and off for... nearly two years now.

This concerns AllTray, which I adopted at the end of 2008.  I rewrote it 
largely in Vala, to make it easier to work on (and the source code 
seriously needed to be rewritten anyway---it had grown organically over 
the years and became a very "legacy" code base).  The rewrite has most 
of the functionality, but some of the things that the old AllTray 
codebase did were far from EWMH compliant, and there were lots of 
"clever tricks" in the source code in order to deal with differences 
between GNOME, KDE, Compiz, and other window managers and the like.

One of the goals of this rewrite of AllTray was to make it possible to 
run on all systems, and try to adhere to the X11 application principle 
of being network transparent.  The current release version of AllTray 
which distributions are using (or rather, are expected to use) is 0.71a, 
while the current version of the development branch is 0.7.4dev.  The 
0.7.5dev release is blocked on one feature that it would appear everyone 
who uses AllTray much relies on: close-to-tray.

Close-to-tray is one of the features of the old AllTray source that was 
particularly nasty.  It did not work with all window managers.  For 
KWin, it would have the user draw a triangle around the window manager's 
"close" button, and intercept clicks in that area.  For (many) other 
window managers, it would reparent the window and embed it, but that 
came at the cost of breaking drag and drop (not something I am willing 
to compromise in the development series leading up to the next stable 
release).

I spoke with someone who works on X.org a while back (probably four or 
five months ago) and (s)he said to create an X11 window and make its 
parent the window of the application that I am interested in 
controlling.  I've figured out how to do that much.  But it doesn't seem 
to work right.  If I create the X11 window as a child of the root 
window, it shows up correctly; it's opaque and uses the background color 
that I set for it.  If I create it as the child of another application 
window, however, it is like "punching a hole" into the application 
window.  I am, as I so often seem to be when looking at X11 without the 
aid of a toolkit, utterly confused.

I have X11 books here.  They have yet to help me understand the problem. 
  :-/

Help!

	--- Mike


More information about the Ale mailing list