Fractional scaling does not persist while resizing or rebooting in VM windows

Bug #1884754 reported by Niels Keurentjes
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Fix Released
Low
Marco Trevisan (Treviño)
Focal
Fix Released
Low
Marco Trevisan (Treviño)

Bug Description

[ Impact ]

Related to https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1825593, https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1852860, but those report the issues are fixed. They also do not mention the VMware specific issues.

[ Test case ]

Install Ubuntu 20.04 in VMware Player, install open-vm-tools (done automatically with Easy Install), go to settings, enable Fractional Scaling and select any non-integer value.

Results:
 - The scaling is applied
 - After next reboot the setting is reverted to 100%, but should use previous value

[ Regression potential ]

Resolution doesn't adapt properly to the vmware player window size.

---

ProblemType: BugDistroRelease: Ubuntu 20.04
Package: mutter 3.36.2-1ubuntu1~20.04.1
ProcVersionSignature: Ubuntu 5.4.0-37.41-generic 5.4.41
Uname: Linux 5.4.0-37-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.3
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Tue Jun 23 04:30:21 2020
InstallationDate: Installed on 2020-06-22 (1 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bashSourcePackage: mutter
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Niels Keurentjes (curry684) wrote :
Revision history for this message
Niels Keurentjes (curry684) wrote :

As a sidenote: the "Fractional scaling selector" in display settings allows me to choose between 100%, 125%, 175%, 175% and 250%. Note the duplicate 175% that should likely be 150%.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like there are two issues here:

> VMware Tools (open-vm-tools) appears to break, no more seamless mouse between host and Ubuntu

> After next reboot the setting is reverted to 100%

So please choose one of those for this bug to be about. And if you like then open a new bug for the other issue.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually three issues if you include comment #2.

Changed in mutter (Ubuntu):
status: New → Incomplete
tags: added: xrandr-scaling
Revision history for this message
Niels Keurentjes (curry684) wrote :

I opened https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/1885025 for the open-vm-tools issue, I don't know for which package I should file the bug with the missing 150% setting.

Revision history for this message
Niels Keurentjes (curry684) wrote :

gnome-shell seems to be the right one, filed https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1885026

This bug can continue to be about the missing persistence.

summary: - Fractional scaling broken in VMware Player
+ Fractional scaling not persisted in VMware Player
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

For this bug, please:

1. Set a fractional scale value and close Settings.

2. Take a copy of ~/.config/monitors.xml and name it 'before.xml'.

3. Reboot and log in. Make sure the bug occurs.

4. Take a copy of ~/.config/monitors.xml and name it 'after.xml'.

5. Run this command:

   journalctl -b0 > journal.txt

6. Attach all three resulting files here.

description: updated
Revision history for this message
Niels Keurentjes (curry684) wrote :

I think I just found out the real issue, and that information is not going to help you because it will contain seemingly random indicators depending on how I size my windows.

VMware Player, like most virtualization software, runs windowed by default, and that window is dynamically resizeable. Now someone in all their wisdom at Ubuntu apparently decided that the available scaling options depend on the current resolution.

So when I keep the settings screen open, and start resizing the window, thus dynamically resizing the "monitor", I can see the available scaling options change in real time. At 3840x2075 (that's 4k minus the VMware window borders) I see the 100/125/175/175/250 selector, at 3480x1859 I don't even get any fractional scaling options, at really low resolutions all scaling options disappear.

When VMware Player boots, it snaps to the default 1024x768 size. So that's the monitor resolution when the desktop loads, it concludes scaling is not allowed at that level, and resets to 100%, no matter what it was before the reboot.

The real issue appears to be: scaling settings should not be modified based on resolution during boot.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for pointing that out. That sounds relevant to bug 1885026 and this one...

In the case of this bug it explains why the fractional scaling value is not persisted -- because the virtual monitor resolution has changed. Mutter considers that a different display configuration and so won't keep any old settings from it. You can see this as a separate block in your ~/.config/monitors.xml

Changed in mutter (Ubuntu):
importance: Undecided → Low
status: Incomplete → Triaged
summary: - Fractional scaling not persisted in VMware Player
+ Fractional scaling does not persist across reboots in resizable VM
+ windows
Revision history for this message
Niels Keurentjes (curry684) wrote : Re: Fractional scaling does not persist across reboots in resizable VM windows

Considering that Mutter indeed knows that a monitor is virtual - shouldn't it just ignore resolution completely for resolving existing configuration? It changes all the time while dragging windows on the host machine, maximizing, minimizing etc

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Before we ask you to report the issue upstream we need to check to see if it's a downstream-only bug. Please:

1. Make sure Wayland fractional support is enabled:

  gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer', 'x11-randr-fractional-scaling']"

  (GUI support is coming - bug 1871864)

2. Log out.

3. Select 'Ubuntu on Wayland' from the login screen.

4. Does this bug still happen in a Wayland session?

Changed in mutter (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Niels Keurentjes (curry684) wrote :

Wayland doesn't work at all, hangs for 5+ minutes after login in VMware (this reflects my experiences with Wayland on 18.04 and 18.10 in VMware, don't think I've ever seen it work properly).

Changed in mutter (Ubuntu):
status: Incomplete → Triaged
Changed in mutter (Ubuntu):
status: Triaged → In Progress
Changed in mutter (Ubuntu Focal):
status: New → In Progress
Changed in mutter (Ubuntu):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Changed in mutter (Ubuntu Focal):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.36.3-1ubuntu2

---------------
mutter (3.36.3-1ubuntu2) groovy; urgency=medium

  * debian/control:
    - Revert BD on adwaita-icon-theme 3.36.1-2ubuntu3. It was just temporary fix.
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Use pre-computed CRTC layout size for computing screen size (LP: #1874567,
      LP: #1873403)
    - Decouple the output mode from layout mode capabilities (LP: #1876894,
      LP: #1886996)
    - Ensure we notify CRTC changes on integer scaling changes (LP: #1876894)
    - Apply proper layout monitor config when using fractional scaling
      (LP: #1884754)
    - Restore the fractional settings when reverting to fractional layout
      (LP: #1886996)
  * debian/libmutter-6-0.symbols: Add new private symbol

 -- Marco Trevisan (Treviño) <email address hidden> Sat, 11 Jul 2020 00:44:33 +0200

Changed in mutter (Ubuntu):
status: In Progress → Fix Released
description: updated
Changed in mutter (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Niels, or anyone else affected,

Accepted mutter into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/3.36.4-0ubuntu0.20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-focal
Revision history for this message
Niels Keurentjes (curry684) wrote : Re: Fractional scaling does not persist across reboots in resizable VM windows

Behaviour seems somewhat improved but the root issue is still there.

When rebooting with VMware Player running the scaling is now remembered correctly, however if I then shut the VM down completely and restart it, it still starts up at first in default screen size, removing the scaling.

Also the scaling modifications seem more aggressive now - if I have the windowed VMware Player maximized on my 4k screen (practical resolution 3840x2015, note not 2160 pixels high due to host window chrome) it allows me to set 125% scaling, but if I then resize the host window or just unmaximize the 125% options disappear from setting *and Ubuntu snaps right back to 200%*.

So effectively what I described in https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1884754/comments/9 is still happening as before.

I still think https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1884754/comments/11 is the only true fix - in _virtual_ monitors the system should never intervene with scaling settings at all and just trust whatever the user selects for himself, as he may be resizing, maximizing, changing displays etc. all the time.

Revision history for this message
Niels Keurentjes (curry684) wrote :

Made a quick video to illustrate the issues: https://youtu.be/SwBtxqTqsHc

summary: - Fractional scaling does not persist across reboots in resizable VM
+ Fractional scaling does not persist while resizing or rebooting in VM
windows
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Well, I'd handle this in a different bug...

I see the problem, but as you said this is a virtual window and the flag mutter uses, isn't specific enough to determine whether this a virtual window.

But giving that the issue of preserving the configuration, when the window has the same size, I'd mark this as resolved, while please open a new report about the problem of scaling not being preserved while the window is resized.

This is something that might not be easy to address, but I will see what's possible.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Unfortunately I think that means you will need to open a copy of this bug again, after this one closes.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Niels, or anyone else affected,

Accepted mutter into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/3.36.4-0ubuntu0.20.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-focal
removed: verification-done verification-done-focal
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Marking this verified again, as it was verified as fixed in version 3.36.4-0ubuntu0.20.04.1 (see [1] and [2]), so given that the changes in .2 [3] do not affect this behavior, we can safely consider it already verified.

[1] https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1884754/comments/16
[2] https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1884754/comments/18
[3] https://launchpadlibrarian.net/490341554/mutter_3.36.4-0ubuntu0.20.04.1_3.36.4-0ubuntu0.20.04.2.diff.gz

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.36.4-0ubuntu0.20.04.2

---------------
mutter (3.36.4-0ubuntu0.20.04.2) focal; urgency=medium

  * xrandr-scaling: Never try to set invalid screen sizes (LP: #1889090)

mutter (3.36.4-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream stable release (LP: #1887998)
    - Fix crash on area screenshots with fractional scaling
    - Do not paint textures of fully obscured windows
    - Turn off CRTCs as well when enabling DPMS
    - Improve selection support
    - Use a more appropriate combine function on opaque areas
    - Fix remote desktop being broken without screencast session
    - Fix popovers disappearing on wayland and HiDPI
    - Fixed crashes (LP: #1870867, LP: #1857947)
    - Plugged memory leaks
  * d/p/screen-cast-Let-the-reason-for-recording-determine-what-t.patch,
    d/p/screen-cast-src-Add-flag-to-maybe_record.patch,
    d/p/screen-cast-src-Fix-signedness-of-timestamp-field.patch,
    d/p/screen-cast-src-Make-record-functions-return-an-error-whe.patch,
    d/p/screen-cast-src-Make-the-two-record-vfuncs-more-similarly.patch,
    d/p/screen-cast-src-Record-follow-up-frame-after-timeout.patch,
    d/p/screen-cast-src-Remove-follow-up-timeout-source-on-disabl.patch,
    d/p/screen-cast-src-Use-G_USEC_PER_SEC-instead-of-1000000.patch,
    d/p/screen-cast-window-stream-src-Fix-indentation.patch:
    - Import more fixes for screencasting and remote desktop
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Don't export patch-only private symbol
  * debian/libmutter-6-0.symbols:
    - Remove ubuntu-only private symbol

mutter (3.36.3-0ubuntu0.20.04.2) focal; urgency=medium

  * debian/control:
    - Revert BD on adwaita-icon-theme 3.36.1-2ubuntu3. It was just temporary fix
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Use pre-computed CRTC layout size for computing screen size (LP: #1874567,
      LP: #1873403)
    - Decouple the output mode from layout mode capabilities (LP: #1876894,
      LP: #1886996)
    - Ensure we notify CRTC changes on integer scaling changes (LP: #1876894)
    - Apply proper layout monitor config when using fractional scaling
      (LP: #1884754)
    - Restore the fractional settings when reverting to fractional layout
      (LP: #1886996)
  * debian/libmutter-6-0.symbols: Add new private symbol

 -- Marco Trevisan (Treviño) <email address hidden> Mon, 27 Jul 2020 17:04:41 +0200

Changed in mutter (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for mutter has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.