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

Add vncviewer -UseLocalCursor option to fix UltraVNC invisible cursor problem #1342

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions vncviewer/Viewport.cxx
Expand Up @@ -185,8 +185,9 @@ Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)

OptionsDialog::addCallback(handleOptions, this);

// Make sure we have an initial blank cursor set
setCursor(0, 0, rfb::Point(0, 0), NULL);
if (!useLocalCursor)
// Make sure we have an initial blank cursor set
setCursor(0, 0, rfb::Point(0, 0), NULL);
}


Expand Down Expand Up @@ -582,7 +583,8 @@ int Viewport::handle(int event)
return 1;

case FL_ENTER:
window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y);
if (!useLocalCursor || cursor)
window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y);
// Yes, we would like some pointer events please!
return 1;

Expand Down Expand Up @@ -1315,7 +1317,7 @@ void Viewport::popupContextMenu()
handle(FL_FOCUS);

// Back to our proper mouse pointer.
if (Fl::belowmouse())
if (useLocalCursor ? ((Fl::belowmouse() == this) && cursor) : (Fl::belowmouse() != NULL))
window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y);

if (m == NULL)
Expand Down
3 changes: 3 additions & 0 deletions vncviewer/parameters.cxx
Expand Up @@ -64,6 +64,8 @@ BoolParameter emulateMiddleButton("EmulateMiddleButton",
BoolParameter dotWhenNoCursor("DotWhenNoCursor",
"Show the dot cursor when the server sends an "
"invisible cursor", false);
BoolParameter useLocalCursor("UseLocalCursor",
"Force a local cursor", false);

BoolParameter alertOnFatalError("AlertOnFatalError",
"Give a dialog on connection problems rather "
Expand Down Expand Up @@ -177,6 +179,7 @@ static VoidParameter* parameterArray[] = {
&SecurityClient::secTypes,
&emulateMiddleButton,
&dotWhenNoCursor,
&useLocalCursor,
&reconnectOnError,
&autoSelect,
&fullColour,
Expand Down
1 change: 1 addition & 0 deletions vncviewer/parameters.h
Expand Up @@ -34,6 +34,7 @@
extern rfb::IntParameter pointerEventInterval;
extern rfb::BoolParameter emulateMiddleButton;
extern rfb::BoolParameter dotWhenNoCursor;
extern rfb::BoolParameter useLocalCursor;

extern rfb::StringParameter passwordFile;

Expand Down
4 changes: 4 additions & 0 deletions vncviewer/vncviewer.man
Expand Up @@ -285,6 +285,10 @@ Use custom compression level. Default if \fBCompressLevel\fP is specified.
Show the dot cursor when the server sends an invisible cursor. Default is off.
.
.TP
.B \-UseLocalCursor
Force a local cursor; needed to work around an UltraVNC interoperability problem. Default is off.
.
.TP
.B \-PointerEventInterval \fItime\fP
Time in milliseconds to rate-limit successive pointer events. Default is
17 ms (60 Hz).
Expand Down