aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-08-07 17:04:43 +0200
committerVaxry <[email protected]>2024-08-07 17:04:49 +0200
commitea728315410e220d73a993f17c83ae9dc9be9015 (patch)
treea491dbf70628ff777a3a7aad5441f5d2ec21cdde
parenta399f98c68d017152883fbf81d67624ac3254073 (diff)
downloadHyprland-ea728315410e220d73a993f17c83ae9dc9be9015.tar.gz
Hyprland-ea728315410e220d73a993f17c83ae9dc9be9015.zip
wayland/compositor: introduce client commit events
-rw-r--r--src/protocols/DRMSyncobj.cpp2
-rw-r--r--src/protocols/core/Compositor.cpp2
-rw-r--r--src/protocols/core/Compositor.hpp5
3 files changed, 6 insertions, 3 deletions
diff --git a/src/protocols/DRMSyncobj.cpp b/src/protocols/DRMSyncobj.cpp
index 37e6d0f1..9a48b99a 100644
--- a/src/protocols/DRMSyncobj.cpp
+++ b/src/protocols/DRMSyncobj.cpp
@@ -75,7 +75,7 @@ CDRMSyncobjSurfaceResource::CDRMSyncobjSurfaceResource(SP<CWpLinuxDrmSyncobjSurf
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
// the current ones
if (pending.releaseTimeline) {
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index 656433d3..a767dd52 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -432,6 +432,8 @@ void CWLSurfaceResource::commitPendingState() {
pending.bufferDamage.clear();
pending.newBuffer = false;
+ events.roleCommit.emit();
+
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);
diff --git a/src/protocols/core/Compositor.hpp b/src/protocols/core/Compositor.hpp
index af0dfa58..a3245399 100644
--- a/src/protocols/core/Compositor.hpp
+++ b/src/protocols/core/Compositor.hpp
@@ -75,8 +75,9 @@ class CWLSurfaceResource {
Vector2D sourceSize();
struct {
- CSignal precommit;
- CSignal commit;
+ CSignal precommit; // before commit
+ CSignal roleCommit; // commit for role objects, before regular commit
+ CSignal commit; // after commit
CSignal map;
CSignal unmap;
CSignal newSubsurface;