fix sharing-mobile view only having control #6764

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

si458 committed Mar 8, 2025 at 17:20 UTC d10173a018d0a6b50b0471108137016b8fa344b2
1 file changed +8 -5
views/sharing-mobile.handlebars
+8 -5
@@ -746,7 +746,7 @@
746 var domainUrl = '{{{domainurl}}}';
747 var authCookie = '{{{authCookie}}}';
748 var authRelayCookie = '{{{authRelayCookie}}}';
749 - var viewOnly = (parseInt('{{{viewOnly}}}') == 1);
749 + var viewOnly = parseInt('{{{viewOnly}}}');
750 var authCookieRenewTimer = null;
751 var serverPublicNamePort = '{{{serverDnsName}}}:{{{serverPublicPort}}}';
752 var debugmode = false;
@@ -864,7 +864,7 @@
864 gotKeyPressEvent = true;
865 Q('softKeyboard').value = '';
866 // Check what keys we are allows to send
867 - if (viewOnly) return false;
867 + if (viewOnly == 1) return false;
868 return desktop.m.handleKeys(e);
869 }
870 if (terminal && !xxdialogMode && (xxcurrentView == 10) && (currentDevicePanel == 5) && (t !== 1)) {
@@ -892,7 +892,7 @@
892 gotKeyPressEvent = false;
893 Q('softKeyboard').value = '';
894 // Check what keys we are allows to send
895 - if (viewOnly) return false;
895 + if (viewOnly == 1) return false;
896 return desktop.m.handleKeyDown(e);
897 }
898 if (terminal && !xxdialogMode && (xxcurrentView == 10) && (currentDevicePanel == 5) && (t !== 1)) {
@@ -921,7 +921,7 @@
921 var inputStr = Q('softKeyboard').value;
922 Q('softKeyboard').value = '';
923 // Check what keys we are allows to send
924 - if (viewOnly) return;
924 + if (viewOnly == 1) return;
925 if ((gotKeyPressEvent == false) && (inputStr.length > 0) && desktop.m.SendKeyUnicode) {
926 // This is a mobile keyboard, we need to send that is in the input control.
927 var inputchar = inputStr[inputStr.length - 1].charCodeAt(0);
@@ -1081,6 +1081,7 @@
1081 desktop = CreateAmtRedirect(CreateAmtRemoteDesktop('Desk'), authCookie);
1082 desktop.debugmode = debugmode;
1083 desktop.onStateChanged = onDesktopStateChange;
1084 + desktop.m.stopInput = (viewOnly == 1);
1085 desktop.m.bpp = (desktopsettings.encoding == 1 || desktopsettings.encoding == 3) ? 1 : 2;
1086 desktop.m.useZRLE = (desktopsettings.encoding < 3);
1087 desktop.m.showmouse = true;
@@ -1090,6 +1091,8 @@
1091 } else if ((contype == null) || (contype == 1) || ((contype == 3))) {
1092 // Setup the Mesh Agent remote desktop
1093 desktop = CreateAgentRedirect(null, CreateAgentRemoteDesktop('Desk'), serverPublicNamePort, authCookie, null, domainUrl);
1094 + desktop.m.stopInput = (viewOnly == 1);
1095 + desktop.m.mouseCursorActive(true);
1096 desktop.debugmode = debugmode;
1097 desktop.m.debugmode = debugmode;
1098 desktop.attemptWebRTC = attemptWebRTC;
@@ -1461,7 +1464,7 @@
1464 QV('deskarea4', !fullscreen);
1465 QV('termarea1', !fullscreen);
1466 QV('termarea4', !fullscreen);
1464 - var inputAllowed = !viewOnly;
1467 + var inputAllowed = (viewOnly == 0);
1468
1469 // Show full screen buttons if needed
1470 QV('deskkeybutton1', fullscreen);