From d6aea3e58f90db35e4f863e0244d7a9a9ba8b720 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Sat, 26 Nov 2022 02:23:15 -0500 Subject: [PATCH] ssd: Add missing state updates - Update `ssd.state` in `ssd_create()` to avoid doing unnecessary work in the next call to `ssd_update_geometry()` - Reset `ssd.margin` in `ssd_destroy()` to avoid accidentally using stale values --- src/ssd/ssd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c index e55221e7..76c6a2b7 100644 --- a/src/ssd/ssd.c +++ b/src/ssd/ssd.c @@ -153,6 +153,11 @@ ssd_create(struct view *view, bool active) ssd_titlebar_create(view); view->ssd.margin = ssd_thickness(view); ssd_set_active(view, active); + + view->ssd.state.width = view->w; + view->ssd.state.height = view->h; + view->ssd.state.x = view->x; + view->ssd.state.y = view->y; } void @@ -202,6 +207,7 @@ ssd_destroy(struct view *view) ssd_extents_destroy(view); wlr_scene_node_destroy(&view->ssd.tree->node); view->ssd.tree = NULL; + view->ssd.margin = (struct border){ 0 }; } bool