[openbox] Smart Window Placement?

Dana Jansens danakj at orodu.net
Mon Feb 4 01:22:55 EST 2008


2008/2/3 George De Bruin <sndchaser at gmail.com>:
> Dana Jansens wrote:
>  > I'm not sure what you're asking for, a formal explanation of the
>  > placement algorithm?
>  >
>  Well, an explanation for one, and whether this is a bug or not for another.
>
>
>  > It doesn't top to bottom or left to right.  It collects rectangles of
>  > space on the screen and sorts them by size (I believe by their area),
>  > and it does this individually for each monitor, choosing the monitors
>  > in an order which can be tweaked with the new <monitor> option in
>  > 3.4.6, but is based on where input focus is, and where the mouse is,
>  > where are windows in its group/parent/children sets.  If you want
>  > stuff to show up in the top left of its assigned rectangle, that is
>  > what the placement <center> option is. Have you looked at the
>  > <placement> section of the default rc.xml at all?
>  >
>  I've looked at both the default rc.xml from my package, which has:
>
>   <placement>
>     <policy>Smart</policy>
>     <!-- 'Smart' or 'UnderMouse' -->
>     <center>no</center>
>     <!-- whether to place windows in the center of the free area found or
>        the top left corner -->
>   </placement>
>
>  Which didn't make me think that the placement would be at all random.
>  And I looked at the website documentation (from:
>  http://icculus.org/openbox/index.php/Configuration):
>
>
>     Placement
>
>  <placement>
>   <policy>Smart</policy>
>  </placement>
>
>  *policy* can be either /Smart/ or /UnderMouse/.
>
>     * /Smart/ will cause new windows to be placed automatically by Openbox.
>     * /UnderMouse/ makes new windows to be placed under the mouse cursor.
>
>
>
>  > And when something doesn't fit in any of the rectangles, it is placed completely randomly.
>  >
>  Boy, I thought by "smart" you meant in the adjective form: witty,
>  clever, intelligent.  It's obvious now that you meant it more like the
>  intransitive verb form: "to cause or be the cause or seat of a sharp
>  stinging pain; /also/ *:* to feel or have such a pain"
>
>  Now I understand: smart = painful = random.
>
>
>  > If you really want to know exactly how it works take a look at place.c
>  >  I've wanted to improve it with FVWM's MinOverlapPercent algorithm,
>  > but usually it seems just fine being random, heh, so I haven't been
>  > itched enough to do so.
>  >
>  Except I don't compile from source.  Don't want to break my package
>  management.  And, even if I did compile from source, it's unlikely that
>  I would go digging through the code to figure out how it works.  I
>  haven't been a coder for a good fifteen years now (beyond a few small
>  shell scripts, and a little PHP dabbling), and haven't done any linux or
>  X coding at all.

place.c has little to do with X or linux, as its just picking
rectangles and integer x and y coords.

>  Personally, I was trying to understand this because I am writing a
>  review of window managers and this behavior didn't make sense.  I mean
>  personally, if I open and close a window N times, I expect the placement
>  to be the same N times (assuming nothing else changes on the screen).
>  But in the case of OpenBox, I was getting up to N different placements,
>  and not seeing a pattern.  Personally, at first I thought I was
>  imagining things...but that FireFox placement just proved that I wasn't
>  imagining things.
>
>  So, I don't know about this.  It doesn't really give me a whole lot of
>  confidence in being able to say that the usability of OpenBox is there.
>  I can't think of a case where this could qualify as a good user
>  interface design.

i'm not sure you really understood.. it places randomly when there is
no space on screen to fit the window. within.  irt to firefox its
going to prefer to place it either where the focus is, or if nothing
has focus, where the mouse is, to keep it where you are working.


- dana



More information about the openbox mailing list