]> git.mdlowis.com Git - proto/labwc.git/commitdiff
ssd: Add missing state updates
authorJohn Lindgren <john@jlindgren.net>
Sat, 26 Nov 2022 07:23:15 +0000 (02:23 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 26 Nov 2022 18:02:24 +0000 (18:02 +0000)
- 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

index e55221e7a5870a933e2147f49876d2510d8384d5..76c6a2b7d28355e649d0ab5e1fb6a206658b3e39 100644 (file)
@@ -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