VirtualBox

Ticket #12816 (new enhancement)

Opened 6 years ago

Last modified 6 years ago

Scale Mode reworked into Zoom function

Reported by: bostjan Owned by:
Component: other Version: VirtualBox 4.3.6
Keywords: Cc:
Guest type: other Host type: other

Description

An essential feature for applications where host resolution cannot be changed at will. Examples are old games and environments where fonts cannot be enlargened to be readable on modern displays with high resolutions.

It has been stated several times that VirtualBox shall not switch host resolution to match the guest. I guess we will have to do with scaling.

Current Scale Mode (as of VirtualBox 4.3.6) is not a proper fullscreen experience, as it retains the host window decorations and cannot truly occupy full screen. But it could be reworked a bit.

What I propose is that Scale Mode does not exist as a separate mode, but only as a specific setting. The setting becomes active whenever the guest resolution and host resolution mismatch in both width and height. Host resolution here means the area which the host gives the guest to use, be it whole screen (fullscreen mode) or VM window client area in window mode.

Options:

  1. 1:1 (note: black borders, as currently in 4.3.6)
  2. Scale the image (with proper aspect ratio)

If user resizes the VM window or enters fullscreen, it works the same as until now: VirtualBox tries to resize the guest desktop to achieve matching. But if the resize fails, scaling is performed (according to user settings).

To put it simply: with scaling enabled, VirtualBox would scale the image in some of the current 'black border' situations.

Note that aspect ratio should be kept unchanged. I cannot imagine a single valid situation when you would want to distort the scaled image. Perhaps as an additional option to scale without regard to ratio, if someone needs it.

At this point, calling it "Zoom" begins to make more sense, as < 100% (reducing) would also be useful. A menu could be introduced to enable selecting specific zooms, similar to text editors, 100% option being most important to enable restoring the exact 1:1 pixel zoom.

VirtualBox already has a fullscreen mode and a working, but not ideal, Scale Mode. These should just be brought together.

Note: there are other fullscreen scaling/zooming enhancements proposed (like #10852), yes. But here I'm describing more precisely how the current Scale Mode can be reworked and become much more useful.

This enhancement is future-proof, as it can be further upgraded if required: adding additional modes, less-than-100% zooming (reducing), etc. It's about moving scaling from the current Scale Mode to where it belongs.

Change History

comment:1 follow-up: ↓ 2 Changed 6 years ago by frank

It's much harder than you probably can imagine to keep the aspect ratio. Currently this is only possible on Windows hosts and Mac OS X hosts. So far we didn't find a way on X11 hosts.

comment:2 in reply to: ↑ 1 Changed 6 years ago by bostjan

Replying to frank:

It's much harder than you probably can imagine to keep the aspect ratio. Currently this is only possible on Windows hosts and Mac OS X hosts. So far we didn't find a way on X11 hosts.


I understand, having host-specific code is always a pain.

So, does VirtualBox currently delegate the scaling to the window manager / OS? Otherwise (if it does software scaling on its own) I don't see any limitation here?

comment:3 follow-up: ↓ 4 Changed 6 years ago by frank

For keeping the aspect ratio, the problem is to prevent a free resizing of the window width/height. That is, if the user moves the right window border, not only the width of the window must be changed but also the height. So far we didn't find a way to do this on X11 hosts.

comment:4 in reply to: ↑ 3 Changed 6 years ago by bostjan

Replying to frank:

For keeping the aspect ratio, the problem is to prevent a free resizing of the window width/height. That is, if the user moves the right window border, not only the width of the window must be changed but also the height. So far we didn't find a way to do this on X11 hosts.


I see. Indeed, that is a difficult task, especially given how decorations may vary in any way imaginable.

If I may ask, why would you want to make the host window keep the aspect ratio at all? When the user resizes the window to any size they desire, why not simply look at the size of the client area, rescale the source image so that it fits while keeping the aspect ratio, and draw the image centered?

True, this would still have black borders on the sides if the ratios (of guest display and target client area) would not match, but the image would be properly upscaled or downscaled in all situations (fullscreen or windowed with user resizing the window), and would keep the original aspect ratio.

comment:5 follow-up: ↓ 6 Changed 6 years ago by frank

Yes, black borders would be an option.

comment:6 in reply to: ↑ 5 Changed 6 years ago by bostjan

Replying to frank:

Yes, black borders would be an option.


I'm glad to hear that.

This would work wonders. With scaling enabled, both fullscreen and windowed mode would scale the image so that minimal black borders would remain - in worst case, there would be some black border on left and right, or on top and bottom, but never on all sides. That's the basic idea about the proposed enhancement.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use