diff --git a/core/rfb.js b/core/rfb.js index 0328d044..d98706e0 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -88,11 +88,14 @@ const extendedClipboardActionNotify = 1 << 27; const extendedClipboardActionProvide = 1 << 28; // [GEOMETRY SPECIFICATIONS](https://www.x.org/releases/X11R7.7/doc/man/man7/X.7.xhtml#heading7) +// [X0VNCSERVER −Geometry](https://tigervnc.org/doc/x0vncserver.html#:~:text=is%2060.-,%E2%88%92Geometry%20geometry) const geometryRegExp = new RegExp([ '^', '(?0|[1-9][0-9]*)', 'x', '(?0|[1-9][0-9]*)', + '(?:', '(?:', '[+](?0|[1-9][0-9]*)', '|', '[-](?0|[1-9][0-9]*)', ')', '(?:', '[+](?0|[1-9][0-9]*)', '|', '[-](?0|[1-9][0-9]*)', ')', + ')?', '$', ].join('')); @@ -851,6 +854,7 @@ export default class RFB extends EventTargetMixin { function compute(width, left, right, maxWidth) { if (width === 0 || width > maxWidth) { width = maxWidth; } if (right === undefined) { + left ??= 0; if (left + width > maxWidth) { left = maxWidth - width; } diff --git a/docs/EMBEDDING.md b/docs/EMBEDDING.md index 9e927d0d..5d203ecd 100644 --- a/docs/EMBEDDING.md +++ b/docs/EMBEDDING.md @@ -85,6 +85,13 @@ Currently, the following options are available: * `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`. +* `crop_rect` - This option specifies the remote framebuffer area that will be + shown in the noVNC client. The format is widthxheight+xoffset+yoffset, where + ‘+’ signs can be replaced with ‘−’ signs to specify offsets from the right + and/or from the bottom of the screen. Offsets are optional, +0+0 is assumed + by default (top left corner). If the argument is empty, full screen is shown + to VNC clients (this is the default). See -Geometry parameter of TigerVNC. + * `quality` - The session JPEG quality level. Can be `0` to `9`. * `compression` - The session compression level. Can be `0` to `9`.