screenshot fix (#2640)

This commit is contained in:
MightyPlaza 2023-07-04 09:40:28 +00:00 committed by GitHub
parent 50755d26d4
commit 283a8e77aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -233,14 +233,14 @@ void CScreencopyProtocolManager::captureOutput(wl_client* client, wl_resource* r
} }
if (box.width == 0 && box.height == 0) if (box.width == 0 && box.height == 0)
PFRAME->box = {0, 0, (int)(PFRAME->pMonitor->vecSize.x * PFRAME->pMonitor->scale), (int)(PFRAME->pMonitor->vecSize.y * PFRAME->pMonitor->scale)}; PFRAME->box = {0, 0, (int)(PFRAME->pMonitor->vecSize.x), (int)(PFRAME->pMonitor->vecSize.y)};
else { else {
PFRAME->box = box; PFRAME->box = box;
scaleBox(&PFRAME->box, PFRAME->pMonitor->scale);
} }
int ow, oh; int ow, oh;
wlr_output_effective_resolution(PFRAME->pMonitor->output, &ow, &oh); wlr_output_effective_resolution(PFRAME->pMonitor->output, &ow, &oh);
wlr_box_transform(&PFRAME->box, &PFRAME->box, PFRAME->pMonitor->transform, ow, oh); wlr_box_transform(&PFRAME->box, &PFRAME->box, PFRAME->pMonitor->transform, ow, oh);
scaleBox(&PFRAME->box, PFRAME->pMonitor->scale);
PFRAME->shmStride = (PSHMINFO->bpp / 8) * PFRAME->box.width; PFRAME->shmStride = (PSHMINFO->bpp / 8) * PFRAME->box.width;