mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04: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);
|
||||
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) {
|
||||
ssd_create(view, view == view->server->focused_view);
|
||||
} else {
|
||||
ssd_destroy(view);
|
||||
}
|
||||
view->ssd_enabled = decorations;
|
||||
if (view->maximized) {
|
||||
view_apply_maximized_geometry(view);
|
||||
} else if (view->tiled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue