regarding proposed smartplacement algoritm:

> On Monday 26 November 2001 12:28, Wilbert Berendsen wrote:
> > Yesterday at 4:24pm, Sean 'Shaleh' Perry said:
> > > > Here are a few of my intial findings.  The proposed algorithm relies
> > > > on knowing the location of all windows.  It then creates a list of
> > > > the uncovered desktop area expressed in rectangles.  This means that
> > > > there would need to be notifications sent on all window placements
> > > > and moves. I will begin work on a coding a basic implimentation of
> > > > the alogrithm soon.
(...)
> > IMHO It's not necessary for bb to keep the list in memory. It may be
> > possible to use the window list Blackbox keeps, and query the X server
> > for the locations and sizes of them each time a new window should be
> > "smart-placed".
>
> Ick, you definately want to keep the list.  Each time you ask the X
> server for the coordinates, that is a round trip... roundtrips take
> time, so you want to do as much as you can client side (in this case,
> window manager side).


Am I stupid, or do we have some misunderstandings here?

Any SmartPlacement algorithm relies on knowing the locations of all
windows (per workspace). (How would you find out where to drop a new
window otherwise? :)

If I'm correct, Blackbox keeps a BlackboxWindow object for every window.
That object also stores it's location (frame.{x,y,width,heigth}).

My proposed algorithm does not need anything else than the
x,y,width,height values of the windows on the current workspace. It just
USES these values to create a in-memory list of available free rectangular
spaces.  Just like the current algorithm uses these values (via the
getWidth,getHeight,getXFrame,getYFrame inline methods) to check if a
particular area is occupied or not.

My algorithm is just the other way 'round. It uses the same input to
compute a list of free spaces, then picks a suitable one (note that that
last step is'nt further detailed in my proposal)  No X server querying
(sorry, I thought that, but now looked at the bb code).

If I have some time i'll try to (help) propose a c++ patch, but while I am
able to read c++ code, writing is another job :)

good luck, thanks, and kind regards!

Wilbert

PS for other interested people: I put the smartplacement alg. description
online at:
http://www.xs4all.nl/~wbsoft/linux/projects/docs/SmartPlacement.tar.gz
(it's a ps and lyx file, sorry for no HTML (don't have latex2html
installed right now))


-- 
Wilbert Berendsen (http://www.xs4all.nl/~wbsoft/)

"To build an apple pie from scratch, you must first invent the universe."
Carl Sagan, Cosmos

Reply via email to