After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779991 - Preserve aspect ratio when scaling VNC display
Preserve aspect ratio when scaling VNC display
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: display
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-03-13 17:39 UTC by Felipe Borges
Modified: 2017-03-27 09:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scaled-display-screenshot (195.56 KB, image/png)
2017-03-13 17:39 UTC, Felipe Borges
  Details
vnc-display: Keep aspect ratio when scaling display (2.20 KB, patch)
2017-03-13 17:39 UTC, Felipe Borges
committed Details | Review
scaling-preserving-aspect-ratio-video (1.01 MB, video/webm)
2017-03-13 17:41 UTC, Felipe Borges
  Details

Description Felipe Borges 2017-03-13 17:39:04 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.
Comment 1 Felipe Borges 2017-03-13 17:39:29 UTC
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])
Comment 2 Felipe Borges 2017-03-13 17:41:34 UTC
Created attachment 347859 [details]
scaling-preserving-aspect-ratio-video
Comment 3 Felipe Borges 2017-03-27 09:06:18 UTC
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