KASM-5598 Get mouse down working cross browser (#98)
* KASM-5598 Get mouse down working cross browser * moved variables declared outside the class --------- Co-authored-by: Chris Hunt <chris.hunt@kasmweb.com> Co-authored-by: mattmcclaskey <matt@kasmweb.com>
This commit is contained in:
parent
5a3b4f0d69
commit
602dff9258
|
@ -1391,6 +1391,8 @@ const UI = {
|
|||
|
||||
UI.hideStatus();
|
||||
|
||||
window.name = 'primaryDisplay'
|
||||
|
||||
if (!host) {
|
||||
Log.Error("Can't connect when host is: " + host);
|
||||
UI.showStatus(_("Must set host"), 'error');
|
||||
|
|
|
@ -206,7 +206,7 @@ const UI = {
|
|||
UI.screenID = screen.screenID
|
||||
UI.screen = screen
|
||||
document.querySelector('title').textContent = 'Display ' + UI.screenID
|
||||
|
||||
window.name = UI.screenID
|
||||
|
||||
if (supportsBinaryClipboard()) {
|
||||
// explicitly request permission to the clipboard
|
||||
|
|
24
core/rfb.js
24
core/rfb.js
|
@ -43,11 +43,6 @@ import { toSignedRelative16bit } from './util/int.js';
|
|||
const DISCONNECT_TIMEOUT = 3;
|
||||
const DEFAULT_BACKGROUND = 'rgb(40, 40, 40)';
|
||||
|
||||
var _videoQuality = 2;
|
||||
var _enableWebP = false;
|
||||
var _enableQOI = false;
|
||||
var _clickEligible = false;
|
||||
|
||||
// Minimum wait (ms) between two mouse moves
|
||||
const MOUSE_MOVE_DELAY = 17;
|
||||
|
||||
|
@ -149,6 +144,8 @@ export default class RFB extends EventTargetMixin {
|
|||
this._useUdp = true;
|
||||
this._hiDpi = 'hiDpi' in options ? !!options.hiDpi : false;
|
||||
this._enableQOI = false;
|
||||
this._videoQuality = 2;
|
||||
this._enableWebP = false;
|
||||
this.TransitConnectionStates = {
|
||||
Tcp: Symbol("tcp"),
|
||||
Udp: Symbol("udp"),
|
||||
|
@ -1451,6 +1448,7 @@ export default class RFB extends EventTargetMixin {
|
|||
this._display.dispose();
|
||||
clearTimeout(this._resizeTimeout);
|
||||
clearTimeout(this._mouseMoveTimer);
|
||||
window.localStorage.removeItem('lastWindow')
|
||||
Log.Debug("<< RFB.disconnect");
|
||||
}
|
||||
|
||||
|
@ -1462,28 +1460,22 @@ export default class RFB extends EventTargetMixin {
|
|||
|
||||
_handleFocusChange(event) {
|
||||
this._resendClipboardNextUserDrivenEvent = true;
|
||||
|
||||
if (event.type == 'focus' && event.currentTarget instanceof Window) {
|
||||
|
||||
if (this._lastVisibilityState === 'visible') {
|
||||
const lastWindow = window.localStorage.getItem('lastWindow')
|
||||
Log.Debug("Window focused while user switched between windows.");
|
||||
// added for multi-montiors
|
||||
// as user moves from window to window, focus change loses a click, this marks the next mouse
|
||||
// move to simulate a left click. We wait for the next mouse move because we need accurate x,y coords
|
||||
if (this._clickEligible) {
|
||||
if (lastWindow != event.currentTarget.name) {
|
||||
this._sendLeftClickonNextMove = true;
|
||||
this._clickEligible = false;
|
||||
window.localStorage.setItem('lastWindow', event.currentTarget.name)
|
||||
}
|
||||
} else {
|
||||
Log.Debug("Window focused while user switched between tabs.");
|
||||
}
|
||||
|
||||
} else if (event.type == 'blur') {
|
||||
// Tell all windows we lost focus
|
||||
let message = {
|
||||
eventType: 'lostFocus'
|
||||
}
|
||||
this._controlChannel.postMessage(message);
|
||||
}
|
||||
|
||||
if (document.visibilityState === "visible" && this._lastVisibilityState === "hidden") {
|
||||
|
@ -1802,10 +1794,6 @@ export default class RFB extends EventTargetMixin {
|
|||
}
|
||||
|
||||
_handleControlMessage(event) {
|
||||
if (event.data.eventType == 'lostFocus') {
|
||||
this._clickEligible = true;
|
||||
return;
|
||||
}
|
||||
if (this._isPrimaryDisplay) {
|
||||
// Secondary to Primary screen message
|
||||
let size;
|
||||
|
|
Loading…
Reference in New Issue