mirror of
https://github.com/labwc/labwc.git
synced 2026-03-05 01:40:24 -05:00
view: Fix SSD margin computation
If `view->ssd_enabled` is false when calling `ssd_create()` then `ssd_thickness()` returns zeroes which are stored in `ssd->margins`. The quick fix is just to ensure we set `view->ssd_enabled` before calling `ssd_create()`. At some point, it might be nice to refactor so that `ssd_create()` does not reference `view->ssd_enabled`.
This commit is contained in:
parent
b203758ce1
commit
cfa51ab628
1 changed files with 5 additions and 1 deletions
|
|
@ -559,12 +559,16 @@ view_set_decorations(struct view *view, bool decorations)
|
||||||
{
|
{
|
||||||
assert(view);
|
assert(view);
|
||||||
if (view->ssd_enabled != decorations && !view->fullscreen) {
|
if (view->ssd_enabled != decorations && !view->fullscreen) {
|
||||||
|
/*
|
||||||
|
* Set view->ssd_enabled first since it is referenced
|
||||||
|
* within the call tree of ssd_create()
|
||||||
|
*/
|
||||||
|
view->ssd_enabled = decorations;
|
||||||
if (decorations) {
|
if (decorations) {
|
||||||
ssd_create(view, view == view->server->focused_view);
|
ssd_create(view, view == view->server->focused_view);
|
||||||
} else {
|
} else {
|
||||||
ssd_destroy(view);
|
ssd_destroy(view);
|
||||||
}
|
}
|
||||||
view->ssd_enabled = decorations;
|
|
||||||
if (view->maximized) {
|
if (view->maximized) {
|
||||||
view_apply_maximized_geometry(view);
|
view_apply_maximized_geometry(view);
|
||||||
} else if (view->tiled) {
|
} else if (view->tiled) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue