diff --git a/app/ui.js b/app/ui.js index 247fc581..8aa37465 100644 --- a/app/ui.js +++ b/app/ui.js @@ -25,8 +25,8 @@ window.updateSetting = (name, value) => { } } -import "core-js/stable"; -import "regenerator-runtime/runtime"; +//import "core-js/stable"; +//import "regenerator-runtime/runtime"; import * as Log from '../core/util/logging.js'; import _, { l10n } from './localization.js'; import { isTouchDevice, isSafari, hasScrollbarGutter, dragThreshold, supportsBinaryClipboard, isFirefox, isWindows, isIOS, supportsPointerLock } diff --git a/core/rfb.js b/core/rfb.js index ac697090..f1e63c4f 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -1935,6 +1935,9 @@ export default class RFB extends EventTargetMixin { false, xvncButtonToMask(mappedButton)); break; case 'mousemove': + //when there are multiple screens + //This window can get mouse move events when the cursor is outside of the window, if the mouse is down + //when the cursor crosses the threshold of the window this._handleMouseMove(pos.x, pos.y); break; } diff --git a/core/util/element.js b/core/util/element.js index 466a7453..5824bd5e 100644 --- a/core/util/element.js +++ b/core/util/element.js @@ -28,5 +28,21 @@ export function clientToElement(x, y, elem) { } else { pos.y = y - bounds.top; } + + //multiple KasmVNC screens, Window can still receive mouse events when cursor goes + //outside of the window if the mouse is down while the moving occurs + if (x > window.innerWidth) { + pos.x += (x - window.innerWidth); + } + else if (x < 0) { + pos.x = x + bounds.left; + } + if (y > window.innerHeight) { + pos.y += (y - window.innerHeight); + } + else if (y < 0) { + pos.y = y + bounds.top; + } + return pos; } diff --git a/vnc.html b/vnc.html index 0cf590b0..c6fa0a33 100644 --- a/vnc.html +++ b/vnc.html @@ -50,7 +50,7 @@ - +