ultravnc / UltraVNC

UltraVNC Server, UltraVNC Viewer and UltraVNC SC | Official repository: https://github.com/ultravnc/UltraVNC
https://uvnc.com
GNU General Public License v3.0
782 stars 186 forks source link

Scale to window improvement and CLI option #48

Open StefanKoell opened 2 years ago

StefanKoell commented 2 years ago

Hi!

in the configuration dialog there's a checkbox "Scale to window": image

I was wondering if there's a CLI option to enable this when starting vncviewer.exe and if not, if this can be implemented.

Also, it would be helpful if this option would preserve the aspect ratio of the screen.

A little background: vncviewer.exe tends to change and enforce the window size when the view is scaled. I have an app which "embeds" the VNC viewer window and hosts multiple VNC sessions in a tabbed interface (similar to what SuperPuTTY does). This seems to be the only "mode" which allows the user to freely resize the VNC viewer window.

Thanks, Stefan

Tki2000 commented 2 years ago

/autoscaling

You should also read the command line parameters page at: https://uvnc.com/docs/uvnc-viewer/52-ultravnc-viewer-commandline-parameters.html

StefanKoell commented 2 years ago

Hi @Tki2000

I tried that before I posted here. The /autoscaling switch does not have the same effect as checking "Scale to window". When I open the connection settings, I get this: CleanShot 2022-06-07 at 14 53 36@2x

DaSigma commented 2 years ago

Try -notoolbar -fullscreen. That worked for me to get the result that I was hoping for. Only thing is, you need to bring toolbar back when needed.

StefanKoell commented 2 years ago

@DaSigma I tried that but the results are not what I want/need. First issue is that the scaling is fixed to 100% and the second issue is that at the top of the screen the fullscreen toolbar slides in.

It seems that it's currently impossible to specify the desired setting through command line args or vnc configuration file. I'm wondering if someone could make this happen in a future version. This would be very helpful for my users.

Thanks, Stefan

RudiDeVos commented 1 year ago

I think you want to use something like this This give you a window without borders, no toolbar and no status window In this case we also controle where it open. The content is sized to fit the window

vncviewer.exe a.b.c.d -position 300 200 1200 800 -noborder -directx -notoolbar -nostatus

Neustradamus commented 1 year ago

@StefanKoell, @Tki2000, @DaSigma: Please read the latest @RudiDeVos edited comment. What do you think?

StefanKoell commented 12 months ago

@Neustradamus @RudiDeVos I just tried your suggestion but it's not really what I was looking for. I can specify position and size only at startup and once I embedded the window, it basically forces to my parent window to the specified size.

Any chance to just expose the setting mentioned in the original post?

RudiDeVos commented 12 months ago

That's -directx= scale to window

StefanKoell commented 12 months ago

@RudiDeVos thanks! That actually answers my original question and is exactly what I was looking for. I'm quite happy with the results.

Out of curiosity: is there a (cli) option to keep the aspect ration in combination with that setting?