Handle subsurfaces of subsurfaces correctly

Damage is not handled properly when subsurfaces have subsurfaces. Of course
`firefox` is doing this because, why not. Anyway, those need to know their
parent as well to figure out the right location for the damage.
This commit is contained in:
raichoo 2021-07-20 19:06:37 +00:00
parent 4d354adbf9
commit 8bcb1c358c
1 changed files with 19 additions and 5 deletions

View File

@ -1657,6 +1657,16 @@ commit_child_handler(struct wl_listener *listener, void *data)
}
}
static void
view_subsurface_create(
struct wlr_subsurface *wlr_subsurface, struct hikari_view *parent)
{
struct hikari_view_subsurface *view_subsurface =
hikari_malloc(sizeof(struct hikari_view_subsurface));
hikari_view_subsurface_init(view_subsurface, parent, wlr_subsurface);
}
static void
new_subsurface_child_handler(struct wl_listener *listener, void *data)
{
@ -1665,11 +1675,7 @@ new_subsurface_child_handler(struct wl_listener *listener, void *data)
struct wlr_subsurface *wlr_subsurface = data;
struct hikari_view_subsurface *view_subsurface =
hikari_malloc(sizeof(struct hikari_view_subsurface));
hikari_view_subsurface_init(
view_subsurface, view_child->parent, wlr_subsurface);
view_subsurface_create(wlr_subsurface, view_child->parent);
}
void
@ -1687,6 +1693,14 @@ hikari_view_child_init(struct hikari_view_child *view_child,
wl_signal_add(&surface->events.commit, &view_child->commit);
wl_list_insert(&parent->children, &view_child->link);
struct wlr_subsurface *subsurface;
wl_list_for_each (subsurface, &surface->subsurfaces_below, parent_link) {
view_subsurface_create(subsurface, parent);
}
wl_list_for_each (subsurface, &surface->subsurfaces_above, parent_link) {
view_subsurface_create(subsurface, parent);
}
}
void