Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu vnc screen resize #640

Open
cxcel opened this issue Nov 29, 2024 · 0 comments
Open

qemu vnc screen resize #640

cxcel opened this issue Nov 29, 2024 · 0 comments
Labels

Comments

@cxcel
Copy link

cxcel commented Nov 29, 2024

When the remote segment changes the resolution, a segmentation fault occurs. rfbEncodingExtDesktopSize and qemu do not match. After turning off rfbEncodingExtDesktopSize, the resolution can be changed normally.

######################
libvncclient code:

diff --git a/src/libvncclient/rfbclient.c b/src/libvncclient/rfbclient.c
index 6f0afac2..5a73eb47 100644
--- a/src/libvncclient/rfbclient.c
+++ b/src/libvncclient/rfbclient.c
@@ -1424,8 +1424,8 @@ SetFormatAndEncodings(rfbClient* client)
/* New Frame Buffer Size */
if (se->nEncodings < MAX_ENCODINGS && client->canHandleNewFBSize)
encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingNewFBSize);

  • if (se->nEncodings < MAX_ENCODINGS)
  • encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingExtDesktopSize);
  • //if (se->nEncodings < MAX_ENCODINGS)

  • // encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingExtDesktopSize);

    /* Last Rect */
    if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding)

#########################
qemu vnc code:

static void vnc_desktop_resize_ext(VncState *vs, int reject_reason)
{
trace_vnc_msg_server_ext_desktop_resize(
vs, vs->ioc, vs->client_width, vs->client_height, reject_reason);

vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1); /* number of rects */
vnc_framebuffer_update(vs,
                       reject_reason ? 1 : 0,
                       reject_reason,
                       vs->client_width, vs->client_height,
                       VNC_ENCODING_DESKTOP_RESIZE_EXT);
vnc_write_u8(vs, 1);  /* number of screens */
vnc_write_u8(vs, 0);  /* padding */
vnc_write_u8(vs, 0);  /* padding */
vnc_write_u8(vs, 0);  /* padding */
vnc_write_u32(vs, 0); /* screen id */
vnc_write_u16(vs, 0); /* screen x-pos */
vnc_write_u16(vs, 0); /* screen y-pos */
vnc_write_u16(vs, vs->client_width);
vnc_write_u16(vs, vs->client_height);
vnc_write_u32(vs, 0); /* screen flags */
vnc_unlock_output(vs);
vnc_flush(vs);

}

@cxcel cxcel added the bug label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant