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

@ -40,6 +40,7 @@ struct WlBufferTransform {
[[nodiscard]] int degrees() const { return 90 * (this->transform & 0b11111011); }
[[nodiscard]] bool flip() const { return this->transform & 0b00000100; }
[[nodiscard]] bool flipSize() const { return this->transform & 0b00000001; }
void apply(QMatrix4x4& matrix) const {
matrix.rotate(this->flip() ? 180 : 0, 0, 1, 0);