开发者

PointerEvent & DesktopSize in RFB protocol

I have a problem I'm actually reco开发者_如何学JAVAding the RFB protocol in my software to comunicate with a VNC Server, and I want to know how to get the size of the server Desktop Size. I have allready test the framebuffer_width inside of the serverInit message but it is not representing the reel size of desktop I don't know how to get it ?

My second question is to send a PointerEvent message to the server. To move the mouse, actually in my software I set the x and y of the mouse to position {0, 0}, when I send this to the VNC server it works successfully, but when I add 5 to the x position it doesn't move 5 pixel it move bigger than what I want, I don't understand why???? can you help me please ?

Thanks for your answers !


Sounds like both of your problems could be a scaling issue in your client.

Some questions that might help you answer your own question (since you really need to post more information if you want a definitive answer):

  • How are you determining that the real size of the desktop is not what is sent as the width in the serverInit message? Perhaps you are starting the VNC server and assuming that it is using the same size as the current desktop on the server and in fact it is starting with a different default size. With VNC servers on *nix systems, the VNC server generally runs as a separate desktop from the main desktop and the size isn't necessarily the same.
  • Are you certain that you are treating the serverInit width and the pointerEvent x and y position as 16-bit values?
  • Are you (advertising and) getting a DesktopSize pseudo-encoding after the ServerInit? It's possible the server may be changing the frame buffer size after you connect.
  • What language/framework/etc are you using to implement the client. Are you certain the rendering functions aren't being scaled somehow?

BTW, I've found the official RFB documentation to be somewhat lacking and I think these links are better for RFB reference:

  • http://tigervnc.sourceforge.net/cgi-bin/rfbproto
  • https://datatracker.ietf.org/doc/draft-levine-rfb/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜