ssd: Allocate struct ssd and struct ssd_hover_state separately

- Store a pointer to the `struct view` in `struct ssd`
- Pass `struct ssd *` instead of `struct view *` to ssd functions
- Add `ssd_get_margin()` convenience function
This commit is contained in:
John Lindgren 2022-11-26 16:46:28 -05:00 committed by Johan Malm
parent cfa51ab628
commit 1e8b0414fe
15 changed files with 112 additions and 65 deletions

View file

@ -303,8 +303,10 @@ position_xdg_toplevel_view(struct view *view)
view->x = center_x - xdg_surface->current.geometry.width / 2;
view->y = center_y - xdg_surface->current.geometry.height / 2;
}
view->x += view->ssd.margin.left;
view->y += view->ssd.margin.top;
struct border margin = ssd_get_margin(view->ssd);
view->x += margin.left;
view->y += margin.top;
}
static const char *