]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Always send mouseUp events properly
authorSamuel Mannehed <samuel@cendio.se>
Wed, 5 Apr 2017 12:00:59 +0000 (14:00 +0200)
committerSamuel Mannehed <samuel@cendio.se>
Wed, 5 Apr 2017 12:00:59 +0000 (14:00 +0200)
If down is false we can't just toggle the current internal state, even
though this is correct most of the time. There are cases where we don't
get the down event and thus won't have a correct internal state. For
example, when clicking in the session after using the clipboard
textarea.

If down is false, we always want to send a mouse event with the button
in 'up'-state.

core/rfb.js

index f40c7d784a5378a9b3ba51e247fa96aa74613ca4..b60a1198596af65a4068e1f721eac00a02a6fec3 100644 (file)
@@ -669,7 +669,7 @@ RFB.prototype = {
         if (down) {
             this._mouse_buttonMask |= bmask;
         } else {
-            this._mouse_buttonMask ^= bmask;
+            this._mouse_buttonMask &= ~bmask;
         }
 
         if (this._viewportDrag) {