On Sun 23 Jun 2013 at 18:30:57 +0200, Rhialto wrote: > | would be if it were possible to keep track of the stacking order > | without explicitly asking the X server with XQueryTree().
I've been thinking about that a bit. Really keeping track of stacking order changes is quite difficult, given the various sorts of re-ordering that can take place on a ConfigureRequest. I did note that in the function WMapRestack() the stacking order is also requested (so that the mini-windows in the Workspace Manager window can be updated). It seems doable to separate the sorting by stacking order to a separate function and use it here also. Additionally we can keep a flag that indicates if this order is up-to-date. It will take some care to invalidate this in all the correct places. Since WMapRestack() is called in loops, this caching may actually reduce the number of calls to XQueryTree(). One weird thing that I noticed is that if you re-start ctwm, then in some cases it will get the stacking order wrong the first time you visit any particular workspace. This becomes quite clear if you insert a "sleep(1);" call after Vanish() and DisplayWin(). The same wrong stacking order can be seen in the Workspace Manager's mini windows. Usually, once you visit the workspace this corrects itself. Sometimes it needs a random stacking order change before it is fixed. I'm not sure why this is. -Olaf. -- ___ Olaf 'Rhialto' Seibert -- The Doctor: No, 'eureka' is Greek for \X/ rhialto/at/xs4all.nl -- 'this bath is too hot.'