diff --git a/core/rfb.js b/core/rfb.js index 739d5809..d2075a0d 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -345,6 +345,7 @@ export default class RFB extends EventTargetMixin { get dragViewport() { return this._dragViewport; } set dragViewport(dragViewport) { this._dragViewport = dragViewport; + this._refreshCursor(); } get scaleViewport() { return this._scaleViewport; } @@ -1121,6 +1122,7 @@ export default class RFB extends EventTargetMixin { case 'mousedown': case 'mouseup': if (this._dragViewport) { + this._cursor.setLocalCursor(down ? 'grabbing' : 'grab'); if (down && !this._viewportDragging) { this._viewportDragging = true; this._viewportDragPos = {'x': pos.x, 'y': pos.y}; @@ -3037,7 +3039,7 @@ export default class RFB extends EventTargetMixin { _shouldShowDotCursor() { // Called when this._cursorImage is updated - if (!this._showDotCursor) { + if (!this._showDotCursor || this._dragViewport) { // User does not want to see the dot, so... return false; } @@ -3067,6 +3069,11 @@ export default class RFB extends EventTargetMixin { image.hotx, image.hoty, image.w, image.h ); + if (this._dragViewport) { + this._cursor.setLocalCursor(this._viewportDragging ? 'grabbing' : 'grab'); + } else { + this._cursor.setLocalCursor('none'); + } } static genDES(password, challenge) {