]> git.mdlowis.com Git - proto/labwc.git/commitdiff
view: no gap for top/left align big window
authorJohan Malm <jgm323@gmail.com>
Mon, 26 Sep 2022 19:16:43 +0000 (20:16 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 27 Sep 2022 16:26:51 +0000 (17:26 +0100)
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
src/view.c

index d6c92de9ea9caab393ccebf1d179c6f1ec71febc..9445282e0b129e8b31582843dbac9e926b7e5467 100644 (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