Add support for notifying clients about pointer movements
This change adds support for the VMware Mouse Position pseudo-encoding[1], which is used to notify VNC clients when X11 clients call `XWarpPointer()`[2]. This function is called by SDL (and other similar libraries) when they detect that the server does not support native relative motion, like some RFB clients. With this, RFB clients can choose to adjust the local cursor position under certain circumstances to match what the server has set. For instance, if pointer lock has been enabled on the client's machine and the cursor is not being drawn locally, the local position of the cursor is irrelevant, so the RFB client can use what the server sends as the canonical absolute position of the cursor. This ultimately enables the possibility of games (especially FPS games) to behave how users expect (if the clients implement the corresponding change). Part of: #619 1: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#vmware-cursor-position-pseudo-encoding 2: https://tronche.com/gui/x/xlib/input/XWarpPointer.html 3: https://hg.libsdl.org/SDL/file/28e3b60e2131/src/events/SDL_mouse.c#l804
This commit is contained in:
@@ -97,6 +97,11 @@ namespace rfb {
|
||||
// cursor.
|
||||
void renderedCursorChange();
|
||||
|
||||
// cursorPositionChange() is called whenever the cursor has changed position by
|
||||
// the server. If the client supports being informed about these changes then
|
||||
// it will arrange for the new cursor position to be sent to the client.
|
||||
void cursorPositionChange();
|
||||
|
||||
// needRenderedCursor() returns true if this client needs the server-side
|
||||
// rendered cursor. This may be because it does not support local cursor
|
||||
// or because the current cursor position has not been set by this client.
|
||||
@@ -223,6 +228,7 @@ namespace rfb {
|
||||
|
||||
void screenLayoutChange(rdr::U16 reason);
|
||||
void setCursor();
|
||||
void setCursorPos();
|
||||
void setDesktopName(const char *name);
|
||||
void setLEDState(unsigned int state);
|
||||
void setSocketTimeouts();
|
||||
|
||||
Reference in New Issue
Block a user