mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
Take into account deco on initial window positioning
This commit is contained in:
parent
9597aeffec
commit
7a5ebbe402
5 changed files with 38 additions and 14 deletions
8
deco.c
8
deco.c
|
|
@ -15,7 +15,7 @@ struct wlr_box deco_max_extents(struct view *view)
|
|||
struct wlr_box deco_box(struct view *view, enum deco_part deco_part)
|
||||
{
|
||||
struct wlr_box box = { .x = 0, .y = 0, .width = 0, .height = 0 };
|
||||
if (!view)
|
||||
if (!view || !view->surface)
|
||||
return box;
|
||||
switch (deco_part) {
|
||||
case LAB_DECO_PART_TOP:
|
||||
|
|
@ -25,6 +25,12 @@ struct wlr_box deco_box(struct view *view, enum deco_part deco_part)
|
|||
view->surface->current.width + 2 * XWL_WINDOW_BORDER;
|
||||
box.height = XWL_TITLEBAR_HEIGHT + XWL_WINDOW_BORDER;
|
||||
break;
|
||||
case LAB_DECO_PART_LEFT:
|
||||
box.x = view->x - XWL_WINDOW_BORDER;
|
||||
box.y = view->y;
|
||||
box.width = XWL_WINDOW_BORDER;
|
||||
box.height = view->surface->current.height;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue