]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg: only position topmost view
authorJohan Malm <jgm323@gmail.com>
Fri, 25 Sep 2020 19:22:18 +0000 (20:22 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 25 Sep 2020 19:22:18 +0000 (20:22 +0100)
src/xdg.c

index a28610cf4d42f2c586f5f6e3c78a72d099a84ef8..5123bc0d52b3d31c55d06fb3a23a48995b66dadc 100644 (file)
--- 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;