view: no gap for top/left align big window

On initial positioning of toplevel windows we call view_center().
During the centering process, if it turns out that the view is larger than
the output usable-area then we just top/left align it with no gap.

Relates to the gap aspect of issue #403

Reported-by: @Flrian
This commit is contained in:
Johan Malm 2022-09-26 20:16:43 +01:00 committed by Johan Malm
parent c4b85041ba
commit d83c58919f

View file

@ -275,11 +275,11 @@ view_compute_centered_position(struct view *view, int w, int h, int *x, int *y)
*y = usable.y + (usable.height - height) / 2;
/* If view is bigger than usable area, just top/left align it */
if (*x < rc.gap) {
*x = rc.gap;
if (*x < 0) {
*x = 0;
}
if (*y < rc.gap) {
*y = rc.gap;
if (*y < 0) {
*y = 0;
}
#if HAVE_XWAYLAND