surface: skip subsurface order commit if unchanged

Also add a small TODO.
This commit is contained in:
Simon Ser 2021-09-06 18:06:22 +02:00
parent 0da7eb18ea
commit d74815682b

View file

@ -458,6 +458,8 @@ static void surface_commit_state(struct wlr_surface *surface,
surface_update_opaque_region(surface); surface_update_opaque_region(surface);
surface_update_input_region(surface); surface_update_input_region(surface);
// TODO: use `next` instead of `surface->pending`
if (surface->pending.committed & WLR_SURFACE_STATE_SUBSURFACES) {
// commit subsurface order // commit subsurface order
struct wlr_subsurface *subsurface; struct wlr_subsurface *subsurface;
wl_list_for_each_reverse(subsurface, &surface->pending.subsurfaces_above, wl_list_for_each_reverse(subsurface, &surface->pending.subsurfaces_above,
@ -482,6 +484,7 @@ static void surface_commit_state(struct wlr_surface *surface,
surface_damage_subsurfaces(subsurface); surface_damage_subsurfaces(subsurface);
} }
} }
}
// If we're committing the pending state, bump the pending sequence number // If we're committing the pending state, bump the pending sequence number
// here, to allow commit listeners to lock the new pending state. // here, to allow commit listeners to lock the new pending state.