Add view_drag parameter to enable dragging when connected

This commit is contained in:
Daniel Hammerschmidt 2025-09-15 21:53:55 +02:00
parent 5782915983
commit 97c0ad4bec
3 changed files with 9 additions and 0 deletions

View File

@ -178,6 +178,7 @@ const UI = {
UI.initSetting('password'); UI.initSetting('password');
UI.initSetting('autoconnect', false); UI.initSetting('autoconnect', false);
UI.initSetting('view_clip', false); UI.initSetting('view_clip', false);
UI.initSetting('view_drag', false);
UI.initSetting('resize', 'off'); UI.initSetting('resize', 'off');
UI.initSetting('quality', 6); UI.initSetting('quality', 6);
UI.initSetting('compression', 2); UI.initSetting('compression', 2);
@ -1096,6 +1097,7 @@ const UI = {
UI.rfb.addEventListener("bell", UI.bell); UI.rfb.addEventListener("bell", UI.bell);
UI.rfb.addEventListener("desktopname", UI.updateDesktopName); UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
UI.rfb.clipViewport = UI.getSetting('view_clip'); UI.rfb.clipViewport = UI.getSetting('view_clip');
UI.rfb.dragViewport = UI.getSetting('view_drag');
UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale'; UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
UI.rfb.resizeSession = UI.getSetting('resize') === 'remote'; UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
UI.rfb.qualityLevel = parseInt(UI.getSetting('quality')); UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));

View File

@ -82,6 +82,9 @@ Currently, the following options are available:
* `view_clip` - If the remote session should be clipped or use scrollbars if * `view_clip` - If the remote session should be clipped or use scrollbars if
it cannot fit in the browser. it cannot fit in the browser.
* `view_drag` - If the remote session is clipped enable dragging the viewport
when connected.
* `resize` - How to resize the remote session if it is not the same size as * `resize` - How to resize the remote session if it is not the same size as
the browser window. Can be one of `off`, `scale` and `remote`. the browser window. Can be one of `off`, `scale` and `remote`.

View File

@ -227,6 +227,10 @@
Clip to window Clip to window
</label> </label>
</li> </li>
<li style="display: none">
<!-- hidden checkbox to enable 'Move/Drag viewport' with url parameter -->
<input id="noVNC_setting_view_clip" type="checkbox">
</li>
<li> <li>
<label for="noVNC_setting_resize">Scaling mode:</label> <label for="noVNC_setting_resize">Scaling mode:</label>
<select id="noVNC_setting_resize" name="vncResize"> <select id="noVNC_setting_resize" name="vncResize">