Skip to content

Instantly share code, notes, and snippets.

@gulafaran
Created March 17, 2025 03:48
Show Gist options
  • Save gulafaran/54b0feb45de6ace8c9cd77ea1c7a140a to your computer and use it in GitHub Desktop.
Save gulafaran/54b0feb45de6ace8c9cd77ea1c7a140a to your computer and use it in GitHub Desktop.
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index a9fe33db..23b42aeb 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -471,12 +471,10 @@ void CWLSurfaceResource::commitPendingState(SSurfaceState& state) {
nullptr);
}
- // release the buffer if it's synchronous as update() has done everything thats needed
+ // release the buffer as update() has done everything thats needed
// so we can let the app know we're done.
- // if (!syncobj && current.buffer && current.buffer->buffer && current.buffer->buffer->isSynchronous()) {
- // dropCurrentBuffer(); // lets not drop it at all, it will get dropped on next commit if a new buffer arrives.
- // solves flickering on nonsyncobj apps on explicit sync.
- // }
+ if (current.buffer && current.buffer->buffer)
+ dropCurrentBuffer();
}
void CWLSurfaceResource::updateCursorShm(CRegion damage) {
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index e7d3630a..69e92fda 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1530,21 +1530,19 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
return ok;
Debug::log(TRACE, "Explicit: {} presented", explicitPresented.size());
- auto sync = g_pHyprOpenGL->createEGLSync(pMonitor->inFence.get());
+ for (auto const& e : explicitPresented) {
+ if (!e->current.buffer || !e->current.buffer->buffer || !e->current.buffer->buffer->syncReleaser)
+ continue;
- if (!sync)
- Debug::log(TRACE, "Explicit: can't add sync, EGLSync failed");
- else {
- for (auto const& e : explicitPresented) {
- if (!e->current.buffer || !e->current.buffer->buffer || !e->current.buffer->buffer->syncReleaser)
- continue;
+ auto sync = g_pHyprOpenGL->createEGLSync(pMonitor->inFence.get());
+ if (!sync)
+ Debug::log(TRACE, "Explicit: can't add sync, EGLSync failed");
+ else
e->current.buffer->buffer->syncReleaser->addReleaseSync(sync);
- }
}
explicitPresented.clear();
- pMonitor->output->state->resetExplicitFences();
return ok;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment