mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:05:58 +01:00
screencopy: move monitor verif check to the proper place
oops
This commit is contained in:
parent
3d9ca6381d
commit
a6ccd36147
1 changed files with 7 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue