summaryrefslogtreecommitdiff
path: root/src/protocols/Screencopy.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-07 23:47:14 +0000
committerVaxry <vaxry@vaxry.net>2024-02-07 23:47:14 +0000
commita6ccd36147109d5cb2981122595f06ae93999b55 (patch)
treeef075c5cdfcf836366554f545f223da5064a5507 /src/protocols/Screencopy.cpp
parent3d9ca6381df1cdbf1731d7e2b39ea3f7574fce1e (diff)
screencopy: move monitor verif check to the proper place
oops
Diffstat (limited to 'src/protocols/Screencopy.cpp')
-rw-r--r--src/protocols/Screencopy.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp
index 5f8c00d4..e9ba45dd 100644
--- a/src/protocols/Screencopy.cpp
+++ b/src/protocols/Screencopy.cpp
@@ -191,13 +191,6 @@ void CScreencopyProtocolManager::captureOutput(wl_client* client, wl_resource* r
PFRAME->resource = wl_resource_create(client, &zwlr_screencopy_frame_v1_interface, wl_resource_get_version(resource), frame);
PFRAME->pMonitor = g_pCompositor->getMonitorFromOutput(wlr_output_from_resource(output));
- if (!g_pCompositor->monitorExists(PFRAME->pMonitor)) {
- Debug::log(ERR, "client requested sharing of a monitor that is gone");
- zwlr_screencopy_frame_v1_send_failed(PFRAME->resource);
- removeFrame(PFRAME);
- return;
- }
-
if (!PFRAME->pMonitor) {
Debug::log(ERR, "client requested sharing of a monitor that doesnt exist");
zwlr_screencopy_frame_v1_send_failed(PFRAME->resource);
@@ -270,6 +263,13 @@ void CScreencopyProtocolManager::copyFrame(wl_client* client, wl_resource* resou
return;
}
+ if (!g_pCompositor->monitorExists(PFRAME->pMonitor)) {
+ Debug::log(ERR, "client requested sharing of a monitor that is gone");
+ zwlr_screencopy_frame_v1_send_failed(PFRAME->resource);
+ removeFrame(PFRAME);
+ return;
+ }
+
const auto PBUFFER = wlr_buffer_try_from_resource(buffer);
if (!PBUFFER) {
Debug::log(ERR, "[sc] invalid buffer in {:x}", (uintptr_t)PFRAME);