mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
xdg: only position topmost view
This commit is contained in:
parent
33d02aa83e
commit
5351299cdd
1 changed files with 10 additions and 3 deletions
13
src/xdg.c
13
src/xdg.c
|
|
@ -142,6 +142,11 @@ static struct border xdg_shell_border(struct view *view)
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool istopmost(struct view *view)
|
||||||
|
{
|
||||||
|
return view->xdg_surface->toplevel->parent == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void xdg_toplevel_view_map(struct view *view)
|
static void xdg_toplevel_view_map(struct view *view)
|
||||||
{
|
{
|
||||||
view->mapped = true;
|
view->mapped = true;
|
||||||
|
|
@ -154,9 +159,11 @@ static void xdg_toplevel_view_map(struct view *view)
|
||||||
view->margin = xdg_shell_border(view);
|
view->margin = xdg_shell_border(view);
|
||||||
view->xdg_grab_offset = -view->margin.left;
|
view->xdg_grab_offset = -view->margin.left;
|
||||||
}
|
}
|
||||||
/* align to edge of screen */
|
if (istopmost(view)) {
|
||||||
view->x += view->margin.left;
|
/* align to edge of screen */
|
||||||
view->y += view->margin.top;
|
view->x += view->margin.left;
|
||||||
|
view->y += view->margin.top;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
view->been_mapped = true;
|
view->been_mapped = true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue