mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-06 04:06:11 -05:00
surface: drop subsurface_commit hook
Move it to the role precommit handler.
This commit is contained in:
parent
659c4bd133
commit
db26319c24
1 changed files with 11 additions and 20 deletions
|
|
@ -496,30 +496,10 @@ static void subsurface_parent_commit(struct wlr_subsurface *subsurface,
|
|||
}
|
||||
}
|
||||
|
||||
static void subsurface_commit(struct wlr_subsurface *subsurface) {
|
||||
struct wlr_surface *surface = subsurface->surface;
|
||||
|
||||
if (subsurface_is_synchronized(subsurface)) {
|
||||
if (subsurface->has_cache) {
|
||||
// We already lock a previous commit. The prevents any future
|
||||
// commit to be applied before we release the previous commit.
|
||||
return;
|
||||
}
|
||||
subsurface->has_cache = true;
|
||||
subsurface->cached_seq = wlr_surface_lock_pending(surface);
|
||||
}
|
||||
}
|
||||
|
||||
static void surface_commit(struct wl_client *client,
|
||||
struct wl_resource *resource) {
|
||||
struct wlr_surface *surface = wlr_surface_from_resource(resource);
|
||||
|
||||
struct wlr_subsurface *subsurface = wlr_surface_is_subsurface(surface) ?
|
||||
wlr_subsurface_from_wlr_surface(surface) : NULL;
|
||||
if (subsurface != NULL) {
|
||||
subsurface_commit(subsurface);
|
||||
}
|
||||
|
||||
if (!surface_state_finalize(surface, &surface->pending)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -536,6 +516,7 @@ static void surface_commit(struct wl_client *client,
|
|||
}
|
||||
surface->pending.seq = next_seq;
|
||||
|
||||
struct wlr_subsurface *subsurface;
|
||||
wl_list_for_each(subsurface, &surface->subsurfaces, parent_link) {
|
||||
subsurface_parent_commit(subsurface, false);
|
||||
}
|
||||
|
|
@ -1068,6 +1049,16 @@ static void subsurface_role_precommit(struct wlr_surface *surface) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (subsurface_is_synchronized(subsurface)) {
|
||||
if (subsurface->has_cache) {
|
||||
// We already lock a previous commit. The prevents any future
|
||||
// commit to be applied before we release the previous commit.
|
||||
return;
|
||||
}
|
||||
subsurface->has_cache = true;
|
||||
subsurface->cached_seq = wlr_surface_lock_pending(surface);
|
||||
}
|
||||
|
||||
if (surface->pending.committed & WLR_SURFACE_STATE_BUFFER &&
|
||||
surface->pending.buffer_resource == NULL) {
|
||||
// This is a NULL commit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue