From 380f4232277dd02d3759c2502f595d853dd45735 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 25 Mar 2020 16:20:11 -0700 Subject: [PATCH] Fixed multi-display fight when two browsers select different displays. --- package.json | 2 +- public/scripts/agent-desktop-0.0.2.js | 2 +- views/default.handlebars | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2af43616..ca5aab06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.5.0-s", + "version": "0.5.0-t", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/scripts/agent-desktop-0.0.2.js b/public/scripts/agent-desktop-0.0.2.js index 3bb0d1e5..2d58dd3d 100644 --- a/public/scripts/agent-desktop-0.0.2.js +++ b/public/scripts/agent-desktop-0.0.2.js @@ -515,7 +515,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) { } obj.GetDisplayNumbers = function () { obj.send(String.fromCharCode(0x00, 0x0B, 0x00, 0x04)); } // Get Terminal display - obj.SetDisplay = function (number) { console.log('Set display', number); obj.send(String.fromCharCode(0x00, 0x0C, 0x00, 0x06, number >> 8, number & 0xFF)); } // Set Terminal display + obj.SetDisplay = function (number) { /*console.log('Set display', number);*/ obj.send(String.fromCharCode(0x00, 0x0C, 0x00, 0x06, number >> 8, number & 0xFF)); } // Set Terminal display obj.intToStr = function (x) { return String.fromCharCode((x >> 24) & 0xFF, (x >> 16) & 0xFF, (x >> 8) & 0xFF, x & 0xFF); } obj.shortToStr = function (x) { return String.fromCharCode((x >> 8) & 0xFF, x & 0xFF); } diff --git a/views/default.handlebars b/views/default.handlebars index 24106523..853235d5 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -6327,13 +6327,14 @@ displayCount++; displaySelector += '' + displays[i] + ''; if ((deskPreferedStickyDisplay == i) && (selDisplay != deskPreferedStickyDisplay)) { desktop.m.SetDisplay(i); } + deskPreferedStickyDisplay = -1; } QH('termdisplays', displaySelector); QV('termdisplays', displayCount > 1); } function deskGetDisplayNumbers(e) { desktop.m.GetDisplayNumbers(); } - var deskPreferedStickyDisplay = 0; + var deskPreferedStickyDisplay = -1; function deskSetDisplay(e) { desktop.m.SetDisplay(deskPreferedStickyDisplay = parseInt(Q('termdisplays').value)); Q('termdisplays').blur(); } // Double click detection. This is important for MacOS.