Le mar, 12 mar 2002, Craig a �crit : > > A behaviour like that would make sense, but I picture it as hard to > > implement. I've been thinking about it for a while now and > > I'm not sure I can see how it could be done. Not even on paper, in a > > reasonably straight-forward and easy way. > > Download the source for sawfish, and check out > sawfish-1.0.1/lisp/wm/util/edges.jl to see how they do it. It doesn't look > too bad. I didn't look at this file, but I also remember a bit of source code of xsnow. This program makes snow fall on the top of "visible" windows. The author (sorry, I don't remember his name) used "Regions" (from Xlib).
You should find source easily with google. See (man) XCreateRegion and XIntersectRegion. In fact, with that algorithm, you keep a description of the outer edge of a stash of overlaped windows : every time a new window is mapped, you substract its area from the empty region, and when it is unmapped, you add the part of root window that becomes visible again. (I am not sure if I am really clear ?) Snap-to-window could become snap-to-the-edge-of-empty-area-on-root-window. Bertrand.
