Page 1 of 1
VirtualBox 4.3.28 changes DPI on window resize
Posted: 24. May 2015, 17:15
by Mike255
I updated from VirtualBox 4.3.26 to 4.3.28 on my Windows 7 host.
I'm running a Linux Mint 17.1 KDE 64bit guest OS.
After updating the I noticed that the text and some icons were sized larger than they had been in 4.3.26.
I can use the xdpyinfo command to find out the current DPI. As you can see from my results below, in 4.3.26 the DPI was 96x96, and it did not change when I resized the VirtualBox window of the guest OS, but in 4.3.28 the DPI is NOT SQUARE, ie it does not have the same DPI horizontally as it does vertically, AND the DPI changes when I resize the guest window (I have auto-resize on).
In 4.3.28 initially with the guest window taking up most of my display's 1920x1080 screen
Code: Select all
$ xdpyinfo | grep dots
resolution: 179x117 dots per inch
In 4.3.28 after resizing the guest window (deliberately to a more portrait shape)
Code: Select all
$ xdpyinfo | grep dots
resolution: 91x113 dots per inch
In 4.3.26 initially
Code: Select all
$ xdpyinfo | grep dots
resolution: 96x96 dots per inch
In 4.3.26 after resize
Code: Select all
$ xdpyinfo | grep dots
resolution: 96x96 dots per inch
A temporary workaround for me for my daily applications, which I'm sure does not work for all applications in my guest, was to use the "System settings | Application settings | Font settings" and check the box to "Force fonts DPI".
Edited to add that the closed thing my searching turned up was
https://www.virtualbox.org/ticket/14123 which I can't tell if it is relevant or not.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 24. May 2015, 17:48
by loukingjr
FWIW, it seems to be a DE issue. I tried with several Linux guests on both VB 4.3.28 and VB 5.0 B4 and with the exception of LXDE, I don't have anything KDE working at the moment, the DPI is always 96 x 96. With LXDE, it varies as described. I should note I don't notice any text or icon differences however.
OSX hosts.
Edit: One thing to mention, if the DPI really was changing images would be distorted. Either stretched or compressed in one direction. Circles would be ovals, squares would be rectangles etc.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 27. May 2015, 20:05
by Mike255
Thanks for researching further. It's interesting that it seems to be DE related. However it must also be related to some change in VirtualBox 4.3.28.
I found the 'xdpyinfo' command when I googled how to check my DPI. I have no idea how or where it gets/calculates it's information, or why it would do it differently in different desktop environments.
Yes I agree that if the DPI was really changed things like images would be distorted, but VirtualBox can't actually change the DPI of my physical screen where those images are ultimately displayed only what it reports is the DPI, so the only things that get affected are those things which are calculated based on the DPI, such as fonts where the pixel grid for a particular point size gets calculated, and probably the font information for a particular font size.
I only really noticed the difference in one application which I'm guessing was basing the width of some items based on the information from the font.
Actually this was interesting, while xdpyinfo (w/ VB 4.3.28) reports the screen resolution differently when I resize, it reports the screen physical dimensions as unchanged!
Code: Select all
xdpyinfo | grep 'dots\|pixels'
dimensions: 1902x939 pixels (270x203 millimeters)
resolution: 179x117 dots per inch
xdpyinfo | grep 'dots\|pixels'
dimensions: 859x872 pixels (270x203 millimeters)
resolution: 81x109 dots per inch
And it seems that 4.3.26 also has different behavior (and not exactly what I expected) when I resize the window.
What I would expect is that the VirtualBox display DPI is constant based on what the Host display's DPI is. Resizing should not change that. I would expect the resolution (# of horizontal and vertical pixels) to change when the window is resized to whatever the size of the window is. I would expect that VirtualBox would use the DPI and resolution to calculate the reported physical dimensions (which xdpyinfo seems to report in millimeters) that it communicates to the guest VM.
Here I've run xdpyinfo after resizing the VirtualBox 4.3.26 VM Window several times (from a different computer, but still Win7 host, with a guest OS of LM 17.1 KDE 32bit).
Note that the DPI stays basically square, but changes as I resize (which I would not have expected). Also see that when I shutdown and restarted the guest OS, the DPI became 96x96 again.
Code: Select all
xdpyinfo | grep 'dots\|pixels'
dimensions: 2369x1310 pixels (517x286 millimeters)
resolution: 116x116 dots per inch
xdpyinfo | grep 'dots\|pixels'
dimensions: 1687x1310 pixels (289x225 millimeters)
resolution: 148x148 dots per inch
xdpyinfo | grep 'dots\|pixels'
dimensions: 1687x1036 pixels (288x176 millimeters)
resolution: 149x150 dots per inch
xdpyinfo | grep 'dots\|pixels'
dimensions: 1687x843 pixels (262x131 millimeters)
resolution: 164x163 dots per inch
xdpyinfo | grep 'dots\|pixels'
dimensions: 1687x1310 pixels (261x202 millimeters)
resolution: 164x165 dots per inch
After shutdown and start up
xdpyinfo | grep 'dots\|pixels'
dimensions: 1687x1310 pixels (445x346 millimeters)
resolution: 96x96 dots per inch
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 27. May 2015, 20:29
by loukingjr
What I would say is you can't count on the accuracy of the xdpyinfo command in a guest.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 28. May 2015, 09:52
by dmischa
the problem seems to appear also on linux hosts as discussed in
viewtopic.php?f=1&t=67837
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 28. May 2015, 14:33
by loukingjr
FWIW, I finally ran into this issue with one particular guest. No I don't remember which one. lol
Fonts were all oversized. However, all I had to do was open the Appearance settings for the guest and click on the font tab then the fonts snapped to the correct size.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 28. May 2015, 23:24
by Mike255
Yes there are ways to work around the issue for now.
However I think this is a genuine bug in VirtualBox that probably should be addressed. It also sounds like it isn't only an issue on Windows hosts, since someone mentioned it happening on Linux hosts also.
I probably should take all the information in this thread and create a bug wherever they belong, but I haven't figured out how to do that yet.
Seems like there was a developer? researching the issue in the linux host thread, I'm not sure if he's aware of this thread.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 29. May 2015, 00:46
by loukingjr
Well, I bit the bullet and downloaded Linux Mint 17.1 KDE and installed it in VB 4.3.28 on a Linux Mint 17.1 Cinnamon host. I had no font issues.
I'm thinking people aren't removing the pre-installed VirtualBox GA files before they install the official GAs or it's just some timing quirk. One person had large fonts installing Ubuntu in VB 5.0 Beta4 but I never have. I did see it once and I think it was a Lubuntu guest but I'm not certain. It certainly isn't consistent whatever it is. I guess we'll find out.
One thing is true, KDE does not force 96x96 DPI fonts unless you tell it to.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 29. May 2015, 14:54
by smithlar
I have a linux host (openSuse 13.2 64 bit), with Windows and Linux guests.
The fonts on my Linux guest almost doubled in size when I upgraded
VirtualBox to 4.3.28. Changing the KDE settings in my Linux guests to force
96 DPI worked around the issue - forcing the DPI is not a "fix". Something
changed in VirtualBox 4.3.28 versus all previous versions that causes this issue.
I've had all of my guests for years without problem.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 29. May 2015, 14:58
by loukingjr
Right now it seems to only affect LXDE and KDE. And not for everyone and not on all hosts. So right now, it's hard to say what is going on. I'm sure it will be resolved at some point.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 9. Jun 2015, 21:21
by Xel'Ra
I'm having exactly the same problem, but with 4.3.26 r98988. This is driving me nuts. I'm running an Arch guest with KDE in a Windows 7 host. The dpi jumps all over the place when resizing. Probably because the screen size stays the same, but the resolution adjusts.
I think this might be a problem with the driver, KMS and xrandr.
Re: VirtualBox 4.3.28 changes DPI on window resize
Posted: 10. Jun 2015, 04:32
by smithlar
Host: openSUSE v13.2, 64 bit, VB 4.3.28
Guest: openSUSE v13.2, 64 bit, VB 4.3.28 GA's
I've verified that installing the VBoxGuestAdditions_4.3.29-100833.iso
.resolves the "oversized fonts" issue in KDE (openSUSE v13.2, 64 bit guest).
In the KDE control panel "Application Appearance/Fonts" I set "Force fonts DPI: 96" back to
"disabled" - the usual default.
A reboot brought back the "oversized fonts" problem.
Installing the test Guest Additions 4.3.29-100833 then rebooting brought all fonts back to normal.
https://www.virtualbox.org/wiki/Testbuilds