GNOME Bugzilla – Bug 779991
Preserve aspect ratio when scaling VNC display
Last modified: 2017-03-27 09:06:22 UTC
Created attachment 347857 [details] scaled-display-screenshot I have connected to my Android phone (in portrait mode) via VNC, and since the display scaling is activate by default, the screen is barely readable. After discussing with jimmac whether we should expose a toggle/switch for the VNC display scaling option, we concluded that Boxes should rely on the most desirable behavior = automatic scaling retaining aspect ratio.
Created attachment 347858 [details] [review] vnc-display: Keep aspect ratio when scaling display A scaled VNC display is barely readable in portrait devices (with reverse aspect ratios, such as 3:4, 5:8, 9:16). There is not benefit on scaling a display without preserving its aspect ratio. The logic behind the scaling is: Given a display ratio D = display_width / display_height and a available_space ratio A = available_width / available_height. if (D > A) scaled_size = (available_width * D, available_height) else scaled_size = (available_width, available_width * D) The resulting allocation structure is also centered (scaled.[x/y])
Created attachment 347859 [details] scaling-preserving-aspect-ratio-video
In most of the cases the vnc display is presented with very irregular/undersired resolutions. This patch scales the display applying a very basic/standard geometrical transformation. Attachment 347858 [details] pushed as 8016cef - vnc-display: Keep aspect ratio when scaling display