Add --render-fit feature

Add an option to configure how the rendering fits the window.

The default, `--render-fit=letterbox`, preserves the aspect ratio
and fits the window as best as possible, adding black bars at
the top/bottom or left/right if needed. This has been the only behavior
scrcpy supported so far.

Another mode, `--render-fit=disabled`, renders the display at the
top-left corner without scaling. This mode will be useful for virtual
display resizing.
This commit is contained in:
Romain Vimont 2026-04-07 21:14:48 +02:00
parent 3b068b669e
commit f7c5f71ea0
9 changed files with 76 additions and 2 deletions

View file

@ -80,6 +80,7 @@ _scrcpy() {
--record-format=
--record-orientation=
--render-driver=
--render-fit=
--require-audio
-s --serial=
-S --turn-screen-off
@ -176,6 +177,10 @@ _scrcpy() {
COMPREPLY=($(compgen -W 'direct3d opengl opengles2 opengles metal software' -- "$cur"))
return
;;
--render-fit)
COMPREPLY=($(compgen -W 'letterbox disabled' -- "$cur"))
return
;;
--shortcut-mod)
# Only auto-complete a single key
COMPREPLY=($(compgen -W 'lctrl rctrl lalt ralt lsuper rsuper' -- "$cur"))