summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bennett <jbennett@incomsystems.biz>2016-04-28 06:46:40 -0500
committerSamuel <samuel@cendio.se>2016-04-28 13:46:40 +0200
commit27e77d468f041e91c717be37d48242d392e2a81a (patch)
treee331da687a9ec1915af8ec1c19485d60fd9212a4
parentf620259bc59dc18e91653918cdb513626a3af8dd (diff)
downloadnovnc-27e77d468f041e91c717be37d48242d392e2a81a.tar.gz
Adds tap-to-click in viewport drag mode (#600)
-rw-r--r--include/rfb.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/rfb.js b/include/rfb.js
index 5d98dbd..e409217 100644
--- a/include/rfb.js
+++ b/include/rfb.js
@@ -119,6 +119,7 @@ var RFB;
this._mouse_arr = [];
this._viewportDragging = false;
this._viewportDragPos = {};
+ this._viewportHasMoved = false;
// set the default value on user-facing properties
Util.set_defaults(this, defaults, {
@@ -593,6 +594,13 @@ var RFB;
return;
} else {
this._viewportDragging = false;
+
+ // If the viewport didn't actually move, then treat as a mouse click event
+ // Send the button down event here, as the button up event is sent at the end of this function
+ if (!this._viewportHasMoved && !this._view_only) {
+ RFB.messages.pointerEvent(this._sock, this._display.absX(x), this._display.absY(y), bmask);
+ }
+ this._viewportHasMoved = false;
}
}
@@ -608,6 +616,11 @@ var RFB;
var deltaY = this._viewportDragPos.y - y;
this._viewportDragPos = {'x': x, 'y': y};
+ // if there is actually viewport move, set the HasMoved flag to true
+ if (deltaX != 0 || deltaY != 0) {
+ this._viewportHasMoved = true;
+ }
+
this._display.viewportChangePos(deltaX, deltaY);
// Skip sending mouse events