From: Guillaume Marcais Date: 2004-03-19T01:17:24+09:00 Subject: Re: Thinking about a window-packing algorithm... Is the algorithm used in 'Expose' available somewhere? That could be a good starting point. Guillaume. On Thu, 2004-03-18 at 03:11, Zachary P. Landau wrote: > > I'm packing child windows into a larger window (MDI fashion). > > Imagine a bulletin board covered by a bunch of overlapping items. > > > > I want to find a "reasonable" way to position the smaller windows. > > > > Ideally part of each one would be exposed. For real-world values, > > that would be impossible, since the total area of the small windows > > would far exceed the total area of the large one. > > Are you familiar with sawfish? It has a 'best-fit' window placement mode > similar to what you describe. It is written in rep, a lisp dialect, but > hopefully it will be easy enough for you to follow. I put the applicable > file at http://kapheine.hypa.net/tmp/smart.jl. If you snag the sawfish > distribution (http://sawfish.sourceforge.net) there are a couple other > placement modes in lisp/sawfish/wm/placement/: off-center, stagger, and > top-left. But I think smart is what you want. > > -- > Zachary P. Landau > GPG: gpg --recv-key 0x24E5AD99 | http://kapheine.hypa.net/kapheine.asc