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
828 stars 190 forks source link

multimonitor server configuration and client supporting ExtendedDesktopSize pseudo-encoding #56

Open mbey-mw opened 2 years ago

mbey-mw commented 2 years ago

Connections from TigerVNC and own client result in 'half' empty screen for multimonitor server configuration.

VNC Server

Windows 10 Pro UltraVNC 1.3.8.1 x64 Screen 1: 1920x1080 @ 0,0 Screen 2: 1280x720 @ 1920,0

VNC Client

TigerVNC 1.12.0 vncviewer own special purpose VNC client

When connecting to the UltraVNC server, the following messages are sent:

Here is the first discrepancy between the framebuffer size and the desktop size. The result is visible in TigerVNC showing the large framebuffer of 3200x1080 with only the rectangle of the first screen (1920x1080) updated. The area of the second screen is not updated (by the server).

When I lock the screen of the Windows with the UltraVNC server and then press space to get to the login screen, the server sends a rectangle with the DesktopSize pseudo-encoding with a size of 1920x1080 (first monitor). And after successful login another recangle reporting a DesktopSize of 3200x1080 is transmitted.

A client only supporting the DesktopSize pseudo-encoding thus will start with a resolution of 1920x1080 and after the lock and unlock of Windows will switch to 3200x1080. A client supporting the ExtendedDesktopSize pseudo-encoding will start with 3200x1080 from the beginning. This seems inconsistent to me.

Assuming that UltraVNC server internally keeps the information which screen (primary, secondary, all) to observe and deliver to the client, it seems to report the wrong DesktopSize when Windows is changing the monitor/screen configuration. Using the UltraVNC client to connect to the same server I'm able to switch between the two monitors and the full extended desktop. All my VNC clients show the same and receive the current screen size as DesktopSize when switching. Locking and unlocking when showing only one monitor/screen results in a too large framebuffer (even for the UltraVNC client). The server is reporting the whole desktop size instead of the size of the currently displayed screen. Same when disconnecting and reconnecting a monitor.

As I understood the ExtendedDesktopSize pseudo-encoding the server should report a framebuffer size containing the whole extended desktop and then list the screens belonging to that desktop and their sizes/positions. The client then is able to show only one screen by requesting updates for the appropriate rectangle.

RudiDeVos commented 2 years ago

This is a complex one, my linux debug options are limited and we also need to stay compatible with older ultravnc versions. Will add it to the dodo list

mbey-mw commented 2 years ago

It is indeed but the UltraVNC client shows the problem when switching desktop size from Windows as well.

As long as the following

primary=1
secondary=1

is set in the ini file, the server works as other VNC servers and all is nice and consistent. But any UltraVNC client can change the server behaviour. Is there a possibility to lock this setting on the server side?

Neustradamus commented 2 years ago

@RudiDeVos: Can you look the last comment?