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

Verify no framebuffer update requests are sent in touchpad mode #211

Closed
6 tasks done
bk138 opened this issue Dec 30, 2022 · 1 comment
Closed
6 tasks done

Verify no framebuffer update requests are sent in touchpad mode #211

bk138 opened this issue Dec 30, 2022 · 1 comment

Comments

@bk138
Copy link
Owner

bk138 commented Dec 30, 2022

re #125 #78

@bk138 bk138 added this to To do in Android: Polish the VNC session UX via automation Dec 30, 2022
@bk138 bk138 self-assigned this Jan 2, 2023
@bk138
Copy link
Owner Author

bk138 commented Jan 28, 2023

outcome: they are still sent, altough #78 tried to prevent this.

the problem

  • is that libvncclient is using SupportsClient2Server() checks to shortcut certain functions to do nothing
  • which is checking client->supportedMessages
  • supportedMessages is used on the libvncserver side to declare caps of the server and inform clients via SupportedMessages encoding
  • on the libvncclient side, however, we kinda unconditionally set the bitsets via DefaultSupportedMessages() and add more if we encounter a Tight or Ultra server. The bad thing is these bitset settings happen after rfbGetClient() and in fact after the first few messages are exchanged.

insights

  • learning 1: supportedMessages on the client if set initially get overridden by the lib :-/
  • learning 2: supportedMessages are not only set by DefaultSupportedMessages() but at least once also on receipt of certain messages (xvp being one case)
  • learning 3: supportedMessages on the client are the only thing evaluated by the lib's functions to decide whether or not to do something :-/

questions

  • ❗ is supportedMessages actually the right place to save the lib user's intent? or is it rather just for managing state depending on the server?
    • 💡 if it's more the latter, it'd be better to handle cl.appData info in libvncclient's functions directly and in addtion to supportedMessages
    • this works as a PoC, but input is then cut off as the remote fb dimensions are not known...
    • 💡💡 i.e.: serverinit message conveys w,h correctly, but later on the client is not notified about fb size changes
    • SendFramebufferUpdateRequest called in reaction to newfbsize and similar events -> rather rare -> limit calls to SendIncrementalFramebufferUpdateRequest which are done at the end of every HandleRFBServerMessage()
  • one stupid way out would be to save intent via rfbClientSetClientData(), then set supportedMessages from this all the time 😐
  • why not simply modify supportedMessages after rfbInitClient()?
    • already doing this, but the Tight-specific DefaultSupportedMessagesTight() gets called later when a sectype is received, overwriting this
    • remove DefaultSupportedMessages() call from DefaultSupportedMessagesTigh() and ultra-counterpart?
      • ❗ yeah, would be possible w/o side effects ✅
  • what about making DefaultSupportedMessages() configurable via cl.appData or the like?
    • app would have to set cl.appData for the init case
    • then for runtime switching app would have to modify supportedMessages
    • two different APIs for the same thing, depending on client state 🤯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant