Skip to content

Smart placement should not place windows on screen borders

Submitted by Lorenzo S.

Assigned to Olivier Fourdan @olivier

Link to original bug (#10771)

Description

I find quite annoying the fact that smart placement places windows on screen borders. If I have maximized windows, for example, I have to move smart-placed new-windows from the top of the screen to access the maximized window title bar, or the same thing for right scrollbars, etc...

I put some lines into placement.h/c source to avoid this, but I know that's only a patch for my own comfort. For sure, a non-default option in config dialog would be better. I added these lines before the last two in smartPlacement() function:

if (best_x < xmin + SMART_PLACEMENT_PADDING) best_x = xmin + SMART_PLACEMENT_PADDING;
if (best_y < ymin + SMART_PLACEMENT_PADDING) best_y = ymin + SMART_PLACEMENT_PADDING;
if (best_x > xmax - SMART_PLACEMENT_PADDING) best_x = xmax - SMART_PLACEMENT_PADDING;
if (best_y > ymax - SMART_PLACEMENT_PADDING) best_y = ymax - SMART_PLACEMENT_PADDING;

Where SMART_PLACEMENT_PADDING is defined in placement.h as 16.

I don't know how this implementation is related or can affect similar still opened reports, such as #4621 and #9976.

Version: 4.10.1