wayland/compositor: introduce client commit events

This commit is contained in:
Vaxry 2024-08-07 17:04:43 +02:00
parent a399f98c68
commit ea72831541
3 changed files with 6 additions and 3 deletions

View File

@ -75,7 +75,7 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(SP<CWpLinuxDrmSyncobjSurf
pending.acquireTimeline->timeline->addWaiter([this]() { surface->unlockPendingState(); }, pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE); pending.acquireTimeline->timeline->addWaiter([this]() { surface->unlockPendingState(); }, pending.acquirePoint, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE);
}); });
listeners.surfaceCommit = surface->events.commit.registerListener([this](std::any d) { listeners.surfaceCommit = surface->events.roleCommit.registerListener([this](std::any d) {
// apply timelines if new ones have been attached, otherwise don't touch // apply timelines if new ones have been attached, otherwise don't touch
// the current ones // the current ones
if (pending.releaseTimeline) { if (pending.releaseTimeline) {

View File

@ -432,6 +432,8 @@ void CWLSurfaceResource::commitPendingState() {
pending.bufferDamage.clear(); pending.bufferDamage.clear();
pending.newBuffer = false; pending.newBuffer = false;
events.roleCommit.emit();
if (syncobj && syncobj->current.releaseTimeline && syncobj->current.releaseTimeline->timeline && current.buffer && current.buffer->buffer) if (syncobj && syncobj->current.releaseTimeline && syncobj->current.releaseTimeline->timeline && current.buffer && current.buffer->buffer)
current.buffer->releaser = makeShared<CSyncReleaser>(syncobj->current.releaseTimeline->timeline, syncobj->current.releasePoint); current.buffer->releaser = makeShared<CSyncReleaser>(syncobj->current.releaseTimeline->timeline, syncobj->current.releasePoint);

View File

@ -75,8 +75,9 @@ class CWLSurfaceResource {
Vector2D sourceSize(); Vector2D sourceSize();
struct { struct {
CSignal precommit; CSignal precommit; // before commit
CSignal commit; CSignal roleCommit; // commit for role objects, before regular commit
CSignal commit; // after commit
CSignal map; CSignal map;
CSignal unmap; CSignal unmap;
CSignal newSubsurface; CSignal newSubsurface;