[openbox] Smart Window Placement?

Dana Jansens danakj at orodu.net
Sun Feb 3 18:07:18 EST 2008


2008/2/3 George De Bruin <sndchaser at gmail.com>:
> I'm thoroughly puzzled by the smart window placement policy of OpenBox
>  as it exists in version 3.4.4.  This just doesn't seem to be doing what
>  I would have expected it to do.
>
>  Here's what I expect: OpenBox should be scanning left to right, from top
>  to bottom of the desktop to determine where there is a large enough open
>  space for the window to be created.
>
>  However, on my system strange things happen.  For example, after just
>  logging into a clean session, I tried to start firefox.  I expected the
>  window to come up on the far left side of the display, which is where it
>  started last time, and was where I closed it out when I exited my
>  previous session.  However, this time, it came up on the right half of
>  the screen.  I don't get it.
>
>  I should explain that I am working inside of Xfce, and that there were a
>  few apps loaded during start up, including a terminal along the bottom
>  of the left side of the screen, snackAmp in the bottom right corner, and
>  two Xfce panels (along the top and far right of the screen).
>
>  None of these should be getting in the way of Firefox starting in it's
>  normal position.  It wasn't going to overlap the terminal window. I've
>  also see more strange behavior with other applications.  For example,
>  I've started ObConf, and had it come up in an empty space, then started
>  another application with a smaller window that should have come up just
>  below it, only to have it centered on a *different* application's
>  window: not remembering where it opened last time, not centered on the
>  screen, not centered on the desktop, and not using any of the free
>  spaces that it would have fit in.  So, I am just baffled, and have to
>  say that this has been the most frustrating aspect of working with
>  OpenBox that I have encountered so far.

I'm not sure what you're asking for, a formal explanation of the
placement algorithm?

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?

And when something doesn't fit in any of the rectangles, it is placed
completely randomly.

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.


dana



More information about the openbox mailing list