Display scale not remembered when X11 Fractional Scaling is enabled

Bug #1825593 reported by hackel
198
This bug affects 41 people
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Fix Released
Medium
Marco Trevisan (Treviño)
Focal
Fix Released
Medium
Marco Trevisan (Treviño)

Bug Description

[ Impact ]

After upgrading to 19.04, I enabled the experimental 'x11-randr-fractional-scaling' setting. If I set scaling to 125, 150, or 200%, the setting is remembered and used the next time I log in. If I set scaling to 100%, however, the next time I log in the scaling switches back to 200% automatically. I only want to use fractional scaling for external monitors.

[ Test case ]

- Use a multi-monitor setup
- Enable Fractional scaling under X11 (from display settings)
- Setup mixed-DPI settings in gnome-control-center
- Log-out
- Log-in again
  + Settings should be preserved

[ Regression potential ]

It's not possible to set some scaling combinations any more with multiple or single monitors.

- Configuration is not restored at all.

[ Known issue ]

Monitor settings won't be preserved disabling fractional scaling or enabling it in the wayland session.

-----

Background: This is on a Dell XPS 9360 with a 1920x1080 ~168 DPI screen. Pretty standard configuration. I have my DisplaySize set to 294x165 in Xorg.conf, Xft.dpi=168, GTK font scaling factor 1.0.

I have been unable to find an appropriate combination of settings where 168 DPI is respected for accurate font rendering, while at the same time not scaling up the rest of the UI to unusable proportions. Fractional scaling seems to be the only way to adjust some Gnome UI elements.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report.

Marco, could you have a look to this one?

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
hackel (hackel) wrote :

I just installed 19.10 on a new laptop with a 4K display and am experiencing this same issue. Once I enable x11-randr-fractional-scaling, scaling and orientation settings with an external display are not remembered. I have to set them over again each time I log in. The ~/.config/monitors.xml file looks right.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Hey, can you verify this again in 20.04?

tags: added: xrandr-scaling
tags: added: eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
Revision history for this message
Zack Orn (zzack1) wrote :

On fresh install of 20.04, 2 x LG 4K displays, AMD 5600XT GPU

Apr 25 13:28:28 xxx systemd[1798]: Starting GNOME Shell on X11...
Apr 25 13:28:28 xxx gnome-shell[10304]: Enabling experimental feature 'x11-randr-fractional-scaling'
Apr 25 13:28:28 xxx /usr/lib/gdm3/gdm-x-session[10123]: (II) AMDGPU(0): EDID vendor "GSM", prod id 23305
...
Apr 25 13:28:28 xxx gnome-shell[10304]: Failed to read monitors config file '/home/xxx/.config/monitors.xml': Logical monitors not adjacent

In the monitors.xml I notice that when fractional scaling and 150% scale my second monitor <x> is set to 5120. When set with fractional scaling off and 200% the <x> is 3840.

Revision history for this message
Zack Orn (zzack1) wrote :
Revision history for this message
Evgeny Vakhteev (evahteev) wrote :

What I found is, when I'm saving my settings in monitors.xml, is have the following:

 <configuration>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <monitor>
        <monitorspec>
          <connector>HDMI-A-1</connector>
          <vendor>ACI</vendor>
          <product>ASUS PB278</product>
          <serial>D3LMTF056504</serial>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>59.950550079345703</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>5120</x>
      <y>0</y>
      <scale>1.5</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>DisplayPort-1</connector>
          <vendor>ACI</vendor>
          <product>ASUS PB287Q</product>
          <serial>0x0001ecd2</serial>
        </monitorspec>
        <mode>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996623992919922</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>

As you can see first one resolution is 2560x1440, but the second one by position starts at x=5120, so 2560x2, as the second one is saved with 1.5 scale. But gnome-shell probably expects them to be adjacent, so expects x=2560

So, when gnome-shell starts it looks like we are failing to pass the adjacent check. And that's exactly what it's saying:

Apr 25 13:28:28 xxx gnome-shell[10304]: Failed to read monitors config file '/home/xxx/.config/monitors.xml': Logical monitors not adjacent

To verify that I made x=2560 in monitors.xml and restarted gnome-shell, all scaling remained in place as they saved and no errors from gnome-shell anymore, but the right screen is half overridden by left one (which is exactly how to position specified now for the scaled screen).

So it looks like config validator in gnome-shell needs to be fixed to behave differently when logical monitors are scaled.

Revision history for this message
Evgeny Vakhteev (evahteev) wrote :

Bug report for gnome-shell submitted: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2690

Revision history for this message
François Rey (w-ubuntu-com) wrote :

Gnome Shell closed the report submitted by Evgeny saying it's an Ubuntu downstream feature.
The duplicate bug 1852860 looks now like a more suitable candidate for tracking at it is assigned to the proper project (?).

Revision history for this message
François Rey (w-ubuntu-com) wrote :

Also this is not just scaling that is not remembered, but also screen relative positions.

summary: - Display: 100% scale not remembered when X11 Fractional Scaling is
- enabled
+ Display: Scale not remembered when X11 Fractional Scaling is enabled
tags: added: focal
Changed in mutter (Ubuntu):
importance: Undecided → Medium
summary: - Display: Scale not remembered when X11 Fractional Scaling is enabled
+ Display scale and layout not remembered when X11 Fractional Scaling is
+ enabled
Revision history for this message
teras (panayotis) wrote : Re: Display scale and layout not remembered when X11 Fractional Scaling is enabled

Hello people
So the bug report https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1852860 is closed, and this post you said it's not a suitable thread. (and at the same time gnome refuses to fix it and Ask Ubuntu closes the bug).

Am I the only one that feels like chasing our own tail?

Changed in gnome-control-center (Ubuntu):
importance: Low → Medium
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We are tracking the issue in this bug now. Sorry for any confusion.

As I understand it we just need to avoid hitting the error "Logical monitors not adjacent".

no longer affects: gnome-control-center (Ubuntu)
Changed in mutter (Ubuntu):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
status: Confirmed → In Progress
Changed in mutter (Ubuntu Focal):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.36.2-1ubuntu1

---------------
mutter (3.36.2-1ubuntu1) groovy; urgency=medium

  * Merge with debian, including new upstream release:
    - Fix super key not working with secondary layout (LP: #1871913)
  * xrandr-scaling: Fix compiler warnings (LP: #1875608)
  * xrandr-scaling: Take care of global UI scale when restoring from config
    (LP: #1825593)
  * Remaining changes with debian:
    - debian/control:
      + Update VCS flags to point to ubuntu salsa branch
    - debian/gbp.conf: update branch to point to ubuntu/master
    - debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
      + X11: Add support for fractional scaling using Randr

mutter (3.36.2-1) unstable; urgency=medium

  * Team upload

  [ Simon McVittie ]
  * New upstream stable release
    - Fix FTBFS with Wayland disabled (non-Linux kernels)
    - X11 copy/paste/selection fixes (LP: #1852183)
    - Fix freeze with some DisplayLink devices
    - Fix a memory leak
    - Synchronize shadows to server-side decorations
    - Fix overview key on X11 when using multiple keyboard layouts
    - Fix painting the redraw clip with the damage region
    - Fix capturing with multiple stage views
    - Fix screencasting of non-maximized windows (LP: #1873942)
    - Various misc fixes and cleanups (LP: #1874818)
    - Update translation: de

  [ Marco Trevisan (Treviño) ]
  * debian/libmutter-6-0.symbols: Update
  * debian/rules: Ignore build failures on riscv64

mutter (3.36.1+git20200419-1) unstable; urgency=medium

  * Team upload

  [ Simon McVittie ]
  * New upstream snapshot from gnome-3-36 branch (3.36.1-42-gda9eb4718)
    - Fix trackball button scrolling
    - Fix tiled (MST) displays
    - Copy/paste fixes, particularly for large images and incremental
      transfers
    - Fall back to closed laptop lid configuration if no other available
      (LP: #1793496)

  [ Jeremy Bicha ]
  * Drop obsolete dh_strip dbgsym migration rule
  * Bump debhelper-compat to 13
    - dh_missing --fail-missing is the default
    - dh_auto_test has several default improvements
    - dh_autoreconf isn't needed with meson
  * debian/watch: Only watch for stable releases

mutter (3.36.1-4) unstable; urgency=medium

  * Team upload
  * Merge changelog from unstable
  * Upload to unstable (starts transition: #954422)
  * Update to upstream gnome-3-36 branch, commit 3.36.1-17-g9a2471db4
    - Fix caps-lock state becoming confused on VT switch
  * d/gbp.conf: Follow upstream/3.36.x branch

 -- Marco Trevisan (Treviño) <email address hidden> Thu, 07 May 2020 02:43:19 +0200

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

Hello hackel, 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.2-1ubuntu1~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.

Changed in mutter (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Oscar Parada (oparada1988) wrote : Re: Display scale and layout not remembered when X11 Fractional Scaling is enabled

Went ahead and enabled proposed updates, updated the machine and rebooted, fractional scaling and display arrangement was remembered. When logging into x11 there was a "big" flicker and display fragments but cleared up once shell loaded. on wayland I dont get the options for frac. scaling even when its enabled. I think thats a separate issue though.

Revision history for this message
Oscar Parada (oparada1988) wrote :

Also to add, the cursor from GDM gets stuck after shell loads, now i have two cursors on the screen, one I control and a second on from gdm thats just stuck there.

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

The cursor issue is bug 1873052.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Egor Rudkov (gren236) wrote :

Upgraded from proposed updates and it works like a charm.

Revision history for this message
krul (krul) wrote :

Not working for me with the proposed package:

mutter/focal-proposed,now 3.36.2-1ubuntu1~20.04.1 amd64 [installed]

I have dual screen setup (see attached) and tried to set fractional scaling to 125%. Scale is reset to 100% both when log off and on and after complete reboot.

Revision history for this message
James Hepworth (jhh27) wrote :

Not working for me either.

I have dual screen setup as below:

Built in display 2560x1440 set to 125% on the left of an HDMI 1920x1080 set to 100% scaling. External display is primary.

Revision history for this message
James Hepworth (jhh27) wrote :

Built in display resets to 200% and move to right hand side of external display on reboot.

Revision history for this message
Karl Nicoll (karlnicoll) wrote :

Confirming that this is not fixed in Mutter 3.36.2-1ubuntu1~20.04.1

$ gnome-shell
mutter-Message: 01:56:00.098: Enabling experimental feature 'x11-randr-fractional-scaling'

(gnome-shell:21601): mutter-WARNING **: 01:56:00.177: Failed to read monitors config file '/home/karl/.config/monitors.xml': Logical monitors not adjacent
org.gnome.Shell already exists on bus and --replace not specified

I'm running three monitors, a centered 4k monitor and a 1080p monitor either side. I've attached my monitors.xml.

Thanks,

Karl

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

I should have thought of this earlier...

 * Please don't comment here if you are using the proprietary Nvidia driver. The Nvidia driver has its own unique problems as is not yet supported.

 * Please don't comment here if your display settings are not remembered when using scale 100%. That is bug 1292398, not this one.

summary: - Display scale and layout not remembered when X11 Fractional Scaling is
- enabled
+ Display scale not remembered when X11 Fractional Scaling is enabled
Revision history for this message
Karl Nicoll (karlnicoll) wrote :

Hi Daniel,

Unsure if your response was aimed at me, but I can confirm that the behaviour is still present for me and that neither of those criteria apply to me. I'm using AMDGPU (AMD Radeon 5700XT) with three monitors attached and fractional scaling enabled.

Additional Observations
=======================

* With Fractional Scaling enabled, but all three screens at 100%, display layout is restored at startup.
* With Fractional Scaling enabled, but screen 3 (the 4k monitor) set at 125% or 150% scaling, the monitor layout and scaling are reset at startup.

If there's any more information you need, I'm happy to help, just let me know what you need!

Thanks,

Karl

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

Karl,

1. Please check the version you have installed:

   dpkg -s libmutter-6-0 | grep Version

   What does it report?

2. Please make sure you have rebooted after installing the new version.

3. Even if the fix still doesn't work for you then I think we should release it anyway as it helps other people. Then you can open a new bug after that.

Revision history for this message
Karl Nicoll (karlnicoll) wrote :

Hi Daniel,

Thanks. `dpkg -s libmutter-6-0 | grep Version` indicated I was still on the old version, turns out I had upgraded mutter, but also needed to upgrade libmutter as well:

    # apt upgrade mutter/focal-proposed
    # apt upgrade gir1.2-mutter-6/focal-proposed libmutter-6-0/focal-proposed

I've run the upgrade and rebooted and the settings are now read correctly (the screen layout and scaling were preserved after the restart).

Nothing more needed at this point, issue appears fixed to me.

Thanks,

Karl

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

Yeah 'mutter' is a binary that we actually don't use in Ubuntu. The part we use for gnome-shell is 'libmutter'.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.36.2-1ubuntu1~20.04.1

---------------
mutter (3.36.2-1ubuntu1~20.04.1) focal; urgency=medium

  * Backport to focal (LP: #1877209)
  * debian/gbp.conf: Set branch to ubuntu/focal
  * debian/control: Update VCS references to focal branch
  * debian/rules: Revert groovy/debian build changes as per dh 13

mutter (3.36.2-1ubuntu1) groovy; urgency=medium

  * Merge with debian, including new upstream release:
    - Fix super key not working with secondary layout (LP: #1871913)
  * xrandr-scaling: Fix compiler warnings (LP: #1874207)
  * xrandr-scaling: Take care of global UI scale when restoring from config
    (LP: #1825593)
  * Remaining changes with debian:
    - debian/control:
      + Update VCS flags to point to ubuntu salsa branch
    - debian/gbp.conf: update branch to point to ubuntu/master
    - debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
      + X11: Add support for fractional scaling using Randr

mutter (3.36.2-1) unstable; urgency=medium

  * Team upload

  [ Simon McVittie ]
  * New upstream stable release
    - Fix FTBFS with Wayland disabled (non-Linux kernels)
    - X11 copy/paste/selection fixes (LP: #1852183)
    - Fix freeze with some DisplayLink devices
    - Fix a memory leak
    - Synchronize shadows to server-side decorations
    - Fix overview key on X11 when using multiple keyboard layouts
    - Fix painting the redraw clip with the damage region
    - Fix capturing with multiple stage views
    - Fix screencasting of non-maximized windows (LP: #1873942)
    - Various misc fixes and cleanups (LP: #1874818)
    - Update translation: de

  [ Marco Trevisan (Treviño) ]
  * debian/libmutter-6-0.symbols: Update
  * debian/rules: Ignore build failures on riscv64

mutter (3.36.1+git20200419-1) unstable; urgency=medium

  * Team upload

  [ Simon McVittie ]
  * New upstream snapshot from gnome-3-36 branch (3.36.1-42-gda9eb4718)
    - Fix trackball button scrolling
    - Fix tiled (MST) displays
    - Copy/paste fixes, particularly for large images and incremental
      transfers
    - Fall back to closed laptop lid configuration if no other available
      (LP: #1793496)

  [ Jeremy Bicha ]
  * Drop obsolete dh_strip dbgsym migration rule
  * Bump debhelper-compat to 13
    - dh_missing --fail-missing is the default
    - dh_auto_test has several default improvements
    - dh_autoreconf isn't needed with meson
  * debian/watch: Only watch for stable releases

mutter (3.36.1-4) unstable; urgency=medium

  * Team upload
  * Merge changelog from unstable
  * Upload to unstable (starts transition: #954422)
  * Update to upstream gnome-3-36 branch, commit 3.36.1-17-g9a2471db4
    - Fix caps-lock state becoming confused on VT switch
  * d/gbp.conf: Follow upstream/3.36.x branch

 -- Marco Trevisan (Treviño) <email address hidden> Thu, 07 May 2020 03:22:16 +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.

Revision history for this message
Artem P (hlcs) wrote :

Update fixed it for me.

Revision history for this message
Manuel J. (maennel) wrote :

The update fixed it for me as well. Thanks for the effort to everyone involved in fixing, reporting, etc.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Thanks folks, this works for me now as well.

Revision history for this message
Cas (calumlind) wrote :

I don't think this is quite fixed.

I have my laptop display set to 2048x1152 and it connects fine to an external monitor via thunderbolt running the full 2560x1440 resolution but when disconnecting the display would reset to default 2560x1440 resolution with 200% scaling.

After reading this bug report about fractional scaling, I disabled the option and now disconnecting the display from the laptop it returns to my preferred 2048x1152 with 100% scaling.

I am using the latest mutter version:

dpkg -s libmutter-6-0 | grep Version
Version: 3.36.2-1ubuntu1~20.04.1

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

Cas,

Please open a new bug by running:

  ubuntu-bug mutter

Revision history for this message
Dave (damies13) wrote :

I can confirm this bug remains even without Fractional Scaling is enabled, and also while using Wayland not X11

In my case I set monitor 1 as primary monitor (primary display port), monitor 3 (secondary display port) with orientation "Portrait Left", after reboot/logout/system update that required reboot, login window appears on monitor 3 in landscape mode, likewise after login monitor 3 is in landscape mode and the primary monitor (has the dock)

|--|--|
| OS Name | Ubuntu 22.04.1 LTS |
| OS Type | 64-bit |
| Gnome Version | 42.5 |
| Windowing System | Wayland |
| Graphics | Mesa Intel® HD Graphics 530 (SKL GT2) |
| Processor | Intel® Core™ i5-6500 CPU @ 3.20GHz × 4 |
| Hardware Model | HP HP EliteDesk 800 G3 DM 65W |

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

This bug is closed. Please report all current issues as new bugs by running:

  ubuntu-bug gnome-shell

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.