mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
xdg: use "usable_area" when positioning view
This commit is contained in:
parent
0eac290d54
commit
22f5073ebd
5 changed files with 34 additions and 35 deletions
12
src/xdg.c
12
src/xdg.c
|
|
@ -224,12 +224,14 @@ static void
|
|||
position_xdg_toplevel_view(struct view *view)
|
||||
{
|
||||
if (istopmost(view)) {
|
||||
struct wlr_box *box = output_box_from_cursor_coords(view->server);
|
||||
view->x = box->x;
|
||||
view->y = box->y;
|
||||
struct wlr_box box = output_usable_area_from_cursor_coords(view->server);
|
||||
view->x = box.x;
|
||||
view->y = box.y;
|
||||
view->w = view->xdg_surface->geometry.width;
|
||||
view->h = view->xdg_surface->geometry.height;
|
||||
view_center(view);
|
||||
if (view->w && view->h) {
|
||||
view_center(view);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* If child-toplevel-views, we center-align relative to their
|
||||
|
|
@ -263,6 +265,7 @@ xdg_toplevel_view_map(struct view *view)
|
|||
view->margin = ssd_thickness(view);
|
||||
ssd_create(view);
|
||||
}
|
||||
|
||||
update_padding(view);
|
||||
position_xdg_toplevel_view(view);
|
||||
|
||||
|
|
@ -275,6 +278,7 @@ xdg_toplevel_view_map(struct view *view)
|
|||
parent_link) {
|
||||
subsurface_create(view, subsurface);
|
||||
}
|
||||
|
||||
view->been_mapped = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue