From 086fd7ece8cc8904909f5a597ab69fe73ecac34c Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 19 Jan 2025 04:51:42 -0800 Subject: [PATCH] protocols: do not destroy screencopy resources before client request (#9048) --- src/protocols/Screencopy.cpp | 4 ---- src/protocols/ToplevelExport.cpp | 6 ------ 2 files changed, 10 deletions(-) diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 5cf54eb49..e0e3a559c 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -28,7 +28,6 @@ CScreencopyFrame::CScreencopyFrame(SP resource_, int32_t if (!pMonitor) { LOGM(ERR, "Client requested sharing of a monitor that doesnt exist"); resource->sendFailed(); - PROTO::screencopy->destroyResource(this); return; } @@ -46,7 +45,6 @@ CScreencopyFrame::CScreencopyFrame(SP resource_, int32_t if (shmFormat == DRM_FORMAT_INVALID) { LOGM(ERR, "No format supported by renderer in capture output"); resource->sendFailed(); - PROTO::screencopy->destroyResource(this); return; } @@ -58,7 +56,6 @@ CScreencopyFrame::CScreencopyFrame(SP resource_, int32_t if (!PSHMINFO) { LOGM(ERR, "No pixel format supported by renderer in capture output"); resource->sendFailed(); - PROTO::screencopy->destroyResource(this); return; } @@ -93,7 +90,6 @@ void CScreencopyFrame::copy(CZwlrScreencopyFrameV1* pFrame, wl_resource* buffer_ if UNLIKELY (!g_pCompositor->monitorExists(pMonitor.lock())) { LOGM(ERR, "Client requested sharing of a monitor that is gone"); resource->sendFailed(); - PROTO::screencopy->destroyResource(this); return; } diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index fb49f7222..8b835b50f 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -86,14 +86,12 @@ CToplevelExportFrame::CToplevelExportFrame(SP re if UNLIKELY (!pWindow) { LOGM(ERR, "Client requested sharing of window handle {:x} which does not exist!", pWindow); resource->sendFailed(); - PROTO::toplevelExport->destroyResource(this); return; } if UNLIKELY (!pWindow->m_bIsMapped) { LOGM(ERR, "Client requested sharing of window handle {:x} which is not shareable!", pWindow); resource->sendFailed(); - PROTO::toplevelExport->destroyResource(this); return; } @@ -109,7 +107,6 @@ CToplevelExportFrame::CToplevelExportFrame(SP re if UNLIKELY (shmFormat == DRM_FORMAT_INVALID) { LOGM(ERR, "No format supported by renderer in capture toplevel"); resource->sendFailed(); - PROTO::toplevelExport->destroyResource(this); return; } @@ -117,7 +114,6 @@ CToplevelExportFrame::CToplevelExportFrame(SP re if UNLIKELY (!PSHMINFO) { LOGM(ERR, "No pixel format supported by renderer in capture toplevel"); resource->sendFailed(); - PROTO::toplevelExport->destroyResource(this); return; } @@ -146,14 +142,12 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou if UNLIKELY (!validMapped(pWindow)) { LOGM(ERR, "Client requested sharing of window handle {:x} which is gone!", pWindow); resource->sendFailed(); - PROTO::toplevelExport->destroyResource(this); return; } if UNLIKELY (!pWindow->m_bIsMapped) { LOGM(ERR, "Client requested sharing of window handle {:x} which is not shareable (2)!", pWindow); resource->sendFailed(); - PROTO::toplevelExport->destroyResource(this); return; }