diff options
| author | Tony Miller <2032667+tnymlr@users.noreply.github.com> | 2026-05-03 06:06:00 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-02 21:06:00 +0100 |
| commit | 334b361c8d1bf17652663768fd9237b46287781f (patch) | |
| tree | 41a24021bf21baf2de138f010a8a8575f5cbef8b /src/layout/algorithm/ModeAlgorithm.cpp | |
| parent | f60e50da007aaf55a24d5e25e7a761f3ead51aaa (diff) | |
screenshare: round captureBox after scaling to fix region capture at fractional scales (#14257)
After scaling m_captureBox from logical to pixel coordinates, the box may
have non-integer dimensions (e.g. logical 401x301 at scale 1.25 -> pixel
501.25x376.25). m_bufferSize is then computed as captureBox.size() and
sent to the client as int32 width/height (truncating the fraction), but
m_bufferSize itself stays as a fractional Vector2D.
When the client allocates the integer-sized buffer and submits it,
CScreenshareFrame::share() rejects it with ERROR_BUFFER_SIZE because
Vector2D::operator== is exact double comparison: (501, 376) != (501.25,
376.25). The frame is sent failed, and the client retries forever.
The SHARE_WINDOW path already rounds its bufferSize; the SHARE_REGION
path didn't. Round the captureBox immediately after scaling so all
downstream consumers (m_bufferSize, render translates) see clean integer
pixel coordinates.
Reproducer at scale 1.25 on a 1920x1080 monitor:
wf-recorder -g '500,200 401x301' -f /tmp/x.mp4
# "Failed to copy frame, retrying..." until exit
wf-recorder -g '500,200 400x300' -f /tmp/x.mp4
# works (400*1.25=500, 300*1.25=375, both integer)
Diffstat (limited to 'src/layout/algorithm/ModeAlgorithm.cpp')
0 files changed, 0 insertions, 0 deletions
