mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
src/ssd/ssd.c: Keep view->margin in sync when toggling decorations
Fixes #409
This commit is contained in:
parent
ef3dbbf29a
commit
09915b8f43
5 changed files with 8 additions and 19 deletions
|
|
@ -17,6 +17,10 @@
|
|||
struct border
|
||||
ssd_thickness(struct view *view)
|
||||
{
|
||||
if (!view->ssd.enabled) {
|
||||
struct border border = { 0 };
|
||||
return border;
|
||||
}
|
||||
struct theme *theme = view->server->theme;
|
||||
struct border border = {
|
||||
.top = theme->title_height + theme->border_width,
|
||||
|
|
@ -159,6 +163,7 @@ ssd_create(struct view *view)
|
|||
ssd_extents_create(view);
|
||||
ssd_border_create(view);
|
||||
ssd_titlebar_create(view);
|
||||
view->margin = ssd_thickness(view);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -171,10 +176,12 @@ ssd_update_geometry(struct view *view)
|
|||
if (!view->ssd.enabled) {
|
||||
if (view->ssd.tree->node.enabled) {
|
||||
wlr_scene_node_set_enabled(&view->ssd.tree->node, false);
|
||||
view->margin = ssd_thickness(view);
|
||||
}
|
||||
return;
|
||||
} else if (!view->ssd.tree->node.enabled) {
|
||||
wlr_scene_node_set_enabled(&view->ssd.tree->node, true);
|
||||
view->margin = ssd_thickness(view);
|
||||
}
|
||||
|
||||
int width = view->w;
|
||||
|
|
@ -198,15 +205,6 @@ ssd_update_geometry(struct view *view)
|
|||
view->ssd.state.y = view->y;
|
||||
}
|
||||
|
||||
void
|
||||
ssd_hide(struct view *view)
|
||||
{
|
||||
if (!view->ssd.tree) {
|
||||
return;
|
||||
}
|
||||
wlr_scene_node_set_enabled(&view->ssd.tree->node, false);
|
||||
}
|
||||
|
||||
void ssd_reload(struct view *view)
|
||||
{
|
||||
if (!view->ssd.tree) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue