wayland/screencopy: apply output transform to wlr screencopy

Note that this only fixes output copies, and not toplevel copies.
Toplevel copies are harder because a toplevel can be on more than
one output. Hopefully we'll all be using image-copy-capture before
this one comes up.

Fixes #75
This commit is contained in:
outfoxxed 2025-06-25 12:34:00 -07:00
parent 27f97c3283
commit d949f91347
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 103 additions and 8 deletions

View file

@ -120,8 +120,14 @@ void ScreencopyView::captureFrame() {
void ScreencopyView::onFrameCaptured() {
this->setFlag(QQuickItem::ItemHasContents);
this->update();
const auto& frontbuffer = this->context->swapchain().frontbuffer();
auto size = frontbuffer->size();
if (frontbuffer->transform.flipSize()) size.transpose();
this->bSourceSize = size;
this->bHasContent = true;
this->bSourceSize = this->context->swapchain().frontbuffer()->size();
}
void ScreencopyView::componentComplete() {