Fixes to user imput locking.
Ylian Saint-Hilaire committed
Apr 28, 2021 at 19:25 UTC
ee3581aa3104eb74843b489769575206443c7a28
2 files changed
+4
-3
public/scripts/agent-desktop-0.0.2.js
+2
-1
@@ -216,6 +216,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
216
}
217
}
218
219
+ console.log('cmd', cmd);
220
switch (cmd) {
221
case 3: // Tile
222
if (obj.FirstDraw) obj.onResize();
@@ -273,7 +274,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
274
break;
275
case 87: // MNG_KVM_INPUT_LOCK
276
if (cmdsize != 5) break;
276
- if (obj.RemoteInputLock != (view[4] != 0)) {
277
+ if ((obj.RemoteInputLock == null) || (obj.RemoteInputLock !== (view[4] != 0))) {
278
obj.RemoteInputLock = (view[4] != 0);
279
if (obj.onRemoteInputLockChanged) { obj.onRemoteInputLockChanged(obj, obj.RemoteInputLock); }
280
}
views/default.handlebars
+2
-2
@@ -7435,7 +7435,7 @@
7435
if (desktop && desktop.m.mouseCursorActive) { desktop.m.mouseCursorActive(true); }
7436
QV('DeskInputLockedButton', desktop.m.RemoteInputLock === 1);
7437
QV('DeskInputUnLockedButton', desktop.m.RemoteInputLock === 0);
7438
- desktop.m.onRemoteInputLockChanged = function(obj, state) { QV('DeskInputLockedButton', state === 1); QV('DeskInputUnLockedButton', state === 0); }
7438
+ desktop.m.onRemoteInputLockChanged = function(obj, state) { QV('DeskInputLockedButton', state); QV('DeskInputUnLockedButton', !state); }
7439
desktopNode = currentNode;
7440
onDesktopStateChange(desktop, desktop.State);
7441
delete multiDesktop[currentNode._id];
@@ -7650,7 +7650,7 @@
7650
if (tsid != null) { desktop.options.tsid = tsid; }
7651
if (consent != null) { desktop.options.consent = consent; }
7652
desktop.onStateChanged = onDesktopStateChange;
7653
- desktop.m.onRemoteInputLockChanged = function(obj, state) { QV('DeskInputLockedButton', state === 1); QV('DeskInputUnLockedButton', state === 0); }
7653
+ desktop.m.onRemoteInputLockChanged = function(obj, state) { QV('DeskInputLockedButton', state); QV('DeskInputUnLockedButton', !state); }
7654
desktop.onConsoleMessageChange = function () {
7655
if (desktop.consoleMessage) {
7656
Q('p11DeskConsoleMsg').innerHTML += formatAgentConsoleMessage(desktop.consoleMessage, desktop.consoleMessageId, desktop.consoleMessageArgs);