From: Johan Malm Date: Fri, 25 Sep 2020 19:22:18 +0000 (+0100) Subject: xdg: only position topmost view X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=5351299cddf6b1478c75da2efaae94c35bf79044;p=proto%2Flabwc.git xdg: only position topmost view --- diff --git a/src/xdg.c b/src/xdg.c index a28610cf..5123bc0d 100644 --- a/src/xdg.c +++ b/src/xdg.c @@ -142,6 +142,11 @@ static struct border xdg_shell_border(struct view *view) return border; } +static bool istopmost(struct view *view) +{ + return view->xdg_surface->toplevel->parent == NULL; +} + static void xdg_toplevel_view_map(struct view *view) { view->mapped = true; @@ -154,9 +159,11 @@ static void xdg_toplevel_view_map(struct view *view) view->margin = xdg_shell_border(view); view->xdg_grab_offset = -view->margin.left; } - /* align to edge of screen */ - view->x += view->margin.left; - view->y += view->margin.top; + if (istopmost(view)) { + /* align to edge of screen */ + view->x += view->margin.left; + view->y += view->margin.top; + } } view->been_mapped = true;