]> git.mdlowis.com Git - proto/labwc.git/commitdiff
view: Align large views to usable area
authorJohn Lindgren <john@jlindgren.net>
Sun, 19 Feb 2023 14:56:58 +0000 (09:56 -0500)
committerJohn Lindgren <john@jlindgren.net>
Mon, 20 Feb 2023 16:50:12 +0000 (11:50 -0500)
src/view.c

index 591595b546e09f25b1bbdf0763992f340b6d1d73..2ff8905518f1f7c7fcc9d75e7b1e2fceedb9802c 100644 (file)
@@ -260,11 +260,11 @@ view_compute_centered_position(struct view *view, struct output *output,
        *y = usable.y + (usable.height - height) / 2;
 
        /* If view is bigger than usable area, just top/left align it */
-       if (*x < 0) {
-               *x = 0;
+       if (*x < usable.x) {
+               *x = usable.x;
        }
-       if (*y < 0) {
-               *y = 0;
+       if (*y < usable.y) {
+               *y = usable.y;
        }
 
 #if HAVE_XWAYLAND