fix latency bouncing monitors (#5756)

Signed-off-by: si458 <simonsmith5521@gmail.com>

Simon Smith committed Feb 2, 2024 at 10:22 UTC 550ee34f0041238d449af85ef33474b9308748ee
1 file changed +7 -3
views/default.handlebars
+7 -3
@@ -730,7 +730,7 @@
730 </div>
731 <div id=deskarea4 class="areaFoot">
732 <div class="toright2">
733 - <span id="DeskLatency" title="Desktop Session Latency"></span>
733 + <span id="DeskLatency" style="line-height:22px;width:50px" title="Desktop Session Latency"></span>
734 <span id="DeskTimer" style="line-height:22px" title="Session time"></span>
735 <input id=DeskToolsButton type=button value=Tools title="Toggle tools view" onkeypress="return false" onkeydown="return false" onclick="toggleDeskTools()" />
736 <span>&nbsp;</span>
@@ -9014,6 +9014,8 @@
9014 QV('deskkeys', inputAllowed);
9015 QE('deskkeys', desktop != null);
9016 QV('DeskTimer', deskState == 3);
9017 + QV('DeskLatency', deskState == 3);
9018 + QS('DeskLatency').display = (deskState == 3 ? 'inline-block' : 'none');
9019
9020 // Enable browser clipboard read if supported
9021 var autoclipboard = ((desktop) && (desktop.contype == 4)) ? desktopsettings.rdpautoclipboard : desktopsettings.autoclipboard;
@@ -9420,9 +9422,10 @@
9422 // Desktop
9423 var latencyStr = '', seconds = 0;
9424 if (desktop && desktop.startTime) {
9423 - if (desktop.latency && (desktop.latency.current >= 0)) { latencyStr = format('{0} ms, ', desktop.latency.current); }
9425 + if (desktop.latency && (desktop.latency.current >= 0)) { latencyStr = format('{0} ms', desktop.latency.current); }
9426 seconds = Math.floor((new Date() - desktop.startTime) / 1000);
9425 - QH('DeskTimer', latencyStr + zeroPad(Math.floor(seconds / 3600), 2) + ':' + zeroPad((Math.floor(seconds / 60) % 60), 2) + ':' + zeroPad((seconds % 60), 2));
9427 + QH('DeskTimer', zeroPad(Math.floor(seconds / 3600), 2) + ':' + zeroPad((Math.floor(seconds / 60) % 60), 2) + ':' + zeroPad((seconds % 60), 2));
9428 + QH('DeskLatency', latencyStr);
9429 // Auto-clipboard
9430 if ((((desktop.contype != 4) && (desktopsettings.autoclipboard === true)) || ((desktop.contype == 4) && (desktopsettings.rdpautoclipboard === true))) && (navigator.clipboard != null) && (navigator.clipboard.readText != null)) {
9431 try {
@@ -9437,6 +9440,7 @@
9440 }
9441 } else {
9442 QH('DeskTimer', '');
9443 + QH('DeskLatency', '');
9444 }
9445
9446 // Terminal