Flush pending pseudo-encodings in writeLosslessRefresh under video mode#358
Open
gaberudy wants to merge 1 commit intokasmtech:masterfrom
Open
Conversation
When `video_mode_available` is true, `writeLosslessRefresh()` early-returns
without emitting an FBU. That's correct for the lossless-refresh data path
(video mode owns the pixel stream), but it also drops any pending
pseudo-encoding rects: cursor shape, cursor position, LED state.
The downstream effect: cursor SHAPE updates (e.g. xfwm4 swapping in the
N-S-resize cursor as the pointer approaches a window edge) sit in
`needSetCursor` until some other framebuffer activity triggers a fresh
FBU. On an idle desktop the cursor stays whatever it was last drawn as,
even after seconds of pointer movement.
Trace into `VNCSConnectionST::writeDataUpdate()`:
if (ui.is_empty() && !writer()->needFakeUpdate() && ...) return;
...
if (!ui.is_empty()) {
encodeManager.writeUpdate(...);
} else {
encodeManager.writeLosslessRefresh(...); // ← we land here
}
So when only a pseudo-encoding is pending and there are no pixel changes,
control routes to `writeLosslessRefresh`, which then bails on video mode
without flushing the pseudo-rects.
Fix: before bailing, send a pseudo-only FBU if `needFakeUpdate()` is set.
Uses `pseudoEncodingLastRect` (or counted nRects when the client doesn't
support last-rect) so the message is self-terminating.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
video_mode_availableis true,writeLosslessRefresh()early-returns without emitting an FBU. That's correct for the lossless-refresh data path (video mode owns the pixel stream), but it also drops any pending pseudo-encoding rects: cursor shape, cursor position, LED state.The downstream effect: cursor SHAPE updates (e.g. xfwm4 swapping in the N-S-resize cursor as the pointer approaches a window edge) sit in
needSetCursoruntil some other framebuffer activity triggers a fresh FBU. On an idle desktop the cursor stays whatever it was last drawn as, even after seconds of pointer movement.Trace into
VNCSConnectionST::writeDataUpdate():if (ui.is_empty() && !writer()->needFakeUpdate() && ...) return;
...
if (!ui.is_empty()) {
encodeManager.writeUpdate(...);
} else {
encodeManager.writeLosslessRefresh(...); // ← we land here
}
So when only a pseudo-encoding is pending and there are no pixel changes, control routes to
writeLosslessRefresh, which then bails on video mode without flushing the pseudo-rects.Fix: before bailing, send a pseudo-only FBU if
needFakeUpdate()is set. UsespseudoEncodingLastRect(or counted nRects when the client doesn't support last-rect) so the message is self-terminating.