From 2cd3cb48164f105a1c066102c8430317d94bb9f0 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 23 Dec 2019 16:26:40 +0100 Subject: [PATCH] Set initial blank cursor If the server doesn't support local cursors and want to render them itself then we need to make sure the local cursor is invisible. This also makes sure we always have some cursor allocated, so we can remove the checks in some places. --- vncviewer/Viewport.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index cd613279..618845f4 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -184,6 +184,9 @@ Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_) setMenuKey(); OptionsDialog::addCallback(handleOptions, this); + + // Make sure we have an initial blank cursor set + setCursor(0, 0, rfb::Point(0, 0), NULL); } @@ -579,8 +582,7 @@ int Viewport::handle(int event) return 1; case FL_ENTER: - if (cursor) - window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y); + window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y); // Yes, we would like some pointer events please! return 1; @@ -1267,7 +1269,7 @@ void Viewport::popupContextMenu() handle(FL_FOCUS); // Back to our proper mouse pointer. - if ((Fl::belowmouse() == this) && cursor) + if (Fl::belowmouse()) window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y); if (m == NULL) @@ -1351,4 +1353,5 @@ void Viewport::handleOptions(void *data) Viewport *self = (Viewport*)data; self->setMenuKey(); + // FIXME: Need to recheck cursor for dotWhenNoCursor } -- 2.39.5