Fixed multi-display fight when two browsers select different displays.

This commit is contained in:
Ylian Saint-Hilaire 2020-03-25 16:20:11 -07:00
parent 5a418b615b
commit 380f423227
3 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.5.0-s",
"version": "0.5.0-t",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -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); }

View File

@ -6327,13 +6327,14 @@
displayCount++;
displaySelector += '<option' + ((selDisplay == i) ? ' selected' : '') + ' value=' + i + '>' + displays[i] + '</option>';
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.