Window placement off-screen

Michael Orlitzky michael at orlitzky.com
Thu Apr 28 20:04:34 CEST 2011


On 04/28/2011 11:58 AM, kenneth marken wrote:
> On 28. april 2011 17:53, Olivier Fourdan wrote:
>> On Thu, Apr 28, 2011 at 5:48 PM, Michael Orlitzky<michael at orlitzky.com>  wrote:
>>> Right now, "at the center" with the slider all the way to the left. I've
>>> tried every other combination with similar results, for emacs and evince
>>> at least.
>>
>> Well, I gave you the explanation, what happens is these applications
>> resize their own window after the initial mapping, thus breaking the
>> optimal position computation.
>>
>> The fix is easy, I could make xfwm4 move such windows so that their
>> content remains visible (the patch is a 1 liner). But I am not sure
>> about the side effects of such a behaviour, as many apps may want to
>> resize their windows and do not expect to be moved.
>>
>> IMHO, the best fix would be for the apps to compute their size before
>> doing the initial mapping, as I think doing a mapping followed by a
>> resize is quite sub-optimal.
>>
> How about adding a option to place programs in the upper left corner? 
> This as it seems most programs resize downwards and to the right.
> 
> centering them on screen is only really practical if one can calculate 
> the center of the program window, right?
> 
> or maybe have them relocated to the upper left corner if the WM sense 
> that they resize right after creation with no mouse or keyboard input 
> related to said change?

If I'm reading the code correctly, I think the placement hint is ignored
under most circumstances anyway.

/*
  If the windows is smaller than the given ratio of the available
  screen area, or if the window is larger than the screen area or if
  the given ratio is higher than 100% place the window at the center.
  Otherwise, place the window "smartly", using the good old CPU
  consuming algorithm...
*/

When one of those conditions are true, it will look up placement_mode
and then defer to either mousePlacement or centerPlacement. In all other
cases, smartPlacement gets used regardless.

Now, smartPlacement is *usually* what I want, but I guess it would be
nice to have the ability to override it. Maybe there should be three
placement options: center, mouse, and smart, with smart being the
default. The first two would unconditionally call centerPlacement or
mousePlacement. The smart choice could defer to centerPlacement or
mousePlacement when it makes sense (like is done now), but otherwise,
try to figure out the best position on its own.

Anyway I have a test in three hours and should not be thinking about
this right now =)



More information about the Xfce mailing list