From: Johan Malm Date: Mon, 6 Jun 2022 17:33:40 +0000 (+0100) Subject: view: take into account top-margin for xwayland views X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=0f2261395235c5b19cb30a63789162bebaf65d0e;p=proto%2Flabwc.git view: take into account top-margin for xwayland views ...in order to center accurately. --- diff --git a/src/view.c b/src/view.c index 6a6f295b..31b73855 100644 --- a/src/view.c +++ b/src/view.c @@ -154,6 +154,15 @@ view_compute_centered_position(struct view *view, int w, int h, int *x, int *y) int height = h + view->margin.top + view->margin.bottom; *x = usable.x + (usable.width - width) / 2; *y = usable.y + (usable.height - height) / 2; + +#if HAVE_XWAYLAND + /* TODO: refactor xwayland.c functions to get rid of this */ + if (view->type == LAB_XWAYLAND_VIEW) { + *x += view->margin.left; + *y += view->margin.top; + } +#endif + return true; }