From 73d09953e84ae4f320498fee8522295899972f25 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 28 Jul 2024 23:41:15 +0200 Subject: [PATCH] core/surface: drop map/unmap events in member funcs causes loops --- src/protocols/core/Compositor.cpp | 4 ---- src/protocols/core/Subcompositor.cpp | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 76907cc2..7275cbf8 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -319,8 +319,6 @@ void CWLSurfaceResource::map() { mapped = true; - events.map.emit(); - timespec now; clock_gettime(CLOCK_MONOTONIC, &now); frame(&now); @@ -335,8 +333,6 @@ void CWLSurfaceResource::unmap() { mapped = false; - events.unmap.emit(); - // release the buffers. // this is necessary for XWayland to function correctly, // as it does not unmap via the traditional commit(null buffer) method, but via the X11 protocol. diff --git a/src/protocols/core/Subcompositor.cpp b/src/protocols/core/Subcompositor.cpp index cbc4063a..01cc0798 100644 --- a/src/protocols/core/Subcompositor.cpp +++ b/src/protocols/core/Subcompositor.cpp @@ -82,11 +82,13 @@ CWLSubsurfaceResource::CWLSubsurfaceResource(SP resource_, SPevents.commit.registerListener([this](std::any d) { if (surface->current.buffer && !surface->mapped) { surface->map(); + surface->events.map.emit(); return; } if (!surface->current.buffer && surface->mapped) { surface->unmap(); + surface->events.unmap.emit(); return; } });