mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 12:41:55 -07:00
core/surface: drop map/unmap events in member funcs
causes loops
This commit is contained in:
@@ -319,8 +319,6 @@ void CWLSurfaceResource::map() {
|
|||||||
|
|
||||||
mapped = true;
|
mapped = true;
|
||||||
|
|
||||||
events.map.emit();
|
|
||||||
|
|
||||||
timespec now;
|
timespec now;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
frame(&now);
|
frame(&now);
|
||||||
@@ -335,8 +333,6 @@ void CWLSurfaceResource::unmap() {
|
|||||||
|
|
||||||
mapped = false;
|
mapped = false;
|
||||||
|
|
||||||
events.unmap.emit();
|
|
||||||
|
|
||||||
// release the buffers.
|
// release the buffers.
|
||||||
// this is necessary for XWayland to function correctly,
|
// 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.
|
// as it does not unmap via the traditional commit(null buffer) method, but via the X11 protocol.
|
||||||
|
@@ -82,11 +82,13 @@ CWLSubsurfaceResource::CWLSubsurfaceResource(SP<CWlSubsurface> resource_, SP<CWL
|
|||||||
listeners.commitSurface = surface->events.commit.registerListener([this](std::any d) {
|
listeners.commitSurface = surface->events.commit.registerListener([this](std::any d) {
|
||||||
if (surface->current.buffer && !surface->mapped) {
|
if (surface->current.buffer && !surface->mapped) {
|
||||||
surface->map();
|
surface->map();
|
||||||
|
surface->events.map.emit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!surface->current.buffer && surface->mapped) {
|
if (!surface->current.buffer && surface->mapped) {
|
||||||
surface->unmap();
|
surface->unmap();
|
||||||
|
surface->events.unmap.emit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user