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

@ -13,7 +13,7 @@
void
ssd_border_create(struct ssd *ssd)
{
struct view *view = wl_container_of(ssd, view, ssd);
struct view *view = ssd->view;
struct theme *theme = view->server->theme;
int width = view->w;
int height = view->h;
@ -51,7 +51,7 @@ ssd_border_create(struct ssd *ssd)
void
ssd_border_update(struct ssd *ssd)
{
struct view *view = wl_container_of(ssd, view, ssd);
struct view *view = ssd->view;
struct theme *theme = view->server->theme;
int width = view->w;