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 788901 - can't set usable scale for hidpi internal display if when using external display less than 1600x1200
can't set usable scale for hidpi internal display if when using external disp...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-10-12 20:14 UTC by David Jordan
Modified: 2017-10-17 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
monitor-manager/xrandr: Use a single supported scales list for all (6.67 KB, patch)
2017-10-13 09:01 UTC, Jonas Ådahl
committed Details | Review

Description David Jordan 2017-10-12 20:14:50 UTC
When plugging in an external 1920 x 1080 monitor to a laptop with a hipdi screen (e.g. 13" 3200x1800), mutter automatically configures the two displays next to each other and keeps the 2x scale factor.

If the user sets the scale factor (using the control center, the dbus api, or the monitors.xml file), they will be stuck at 1x and everything will be tiny on the internal display.  It's not possible to set the scale factor back to 2x, and any attempts to do so will result in mutter complaining that "Logical monitor scales must be identical" or "Scale 2 not valid for resolution 1920x1080".

The user can't even move the external display from the right of the internal to the left without selecting 1x scaling.  The configuration simply won't apply.

It should be possible to set a apply a given scale factor if at least one monitor supports it.  The primary reason to prevent setting a too-high a scale factor is that a user may get stuck in an unusable state.
Comment 1 Jeremy Bicha 2017-10-12 23:36:12 UTC
Have you tried

gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

Then reboot.

I think that Fedora 27 is considering enabling that option.
Comment 2 David Jordan 2017-10-13 01:01:02 UTC
That's for Wayland only, right?  I just tried that gsetting here to confirm, and it didn't do anything.  Dealing with hidpi on X isn't ideal, but is necessary to make things work for users with NVIDIA graphics (or others who can't switch to Wayland yet).
Comment 3 Jonas Ådahl 2017-10-13 09:01:00 UTC
Created attachment 361491 [details] [review]
monitor-manager/xrandr: Use a single supported scales list for all

Under X11 we can only ever have the same scale configured on all
monitors. In order to use e.g. scale 2 when there is a HiDPI monitor
connected, we must not disallow it because there is a monitor that does
not support scale 2. Thus we must show the same scale for every monitor
and monitor mode, even though it might result in a bad experience.

Do this by iterating through all the monitors adding all supported
scales by the preferred mode, combining all the supported scales. This
supported scales list is then used for all monitor and modes no matter
what.
Comment 4 David Jordan 2017-10-13 20:47:36 UTC
Thanks, Jonas!

I tested this patch, and it works as expected.  gnome-control-center works as expected, and it's possible to automate behavior via the dbus api.  It would be great to to get this merged.
Comment 5 Rui Matos 2017-10-16 19:21:08 UTC
Review of attachment 361491 [details] [review]:

looks fine

::: src/backends/x11/meta-monitor-manager-xrandr.c
@@ +77,3 @@
+
+  float *supported_scales;
+  int n_supported_scales;

could be unsigned
Comment 6 Jonas Ådahl 2017-10-17 07:20:56 UTC
(In reply to Rui Matos from comment #5)
> Review of attachment 361491 [details] [review] [review]:
> 
> looks fine
> 
> ::: src/backends/x11/meta-monitor-manager-xrandr.c
> @@ +77,3 @@
> +
> +  float *supported_scales;
> +  int n_supported_scales;
> 
> could be unsigned

The 'n_supported_scales' in meta_monitor_manager_calculate_supported_scale() is an int* which is why it is that here too.
Comment 7 Jonas Ådahl 2017-10-17 07:28:18 UTC
Comment on attachment 361491 [details] [review]
monitor-manager/xrandr: Use a single supported scales list for all

Attachment 361491 [details] pushed as 1a78557 - monitor-manager/xrandr: Use a single supported scales list for all
Comment 8 Jonas Ådahl 2017-10-17 07:41:40 UTC
Backported to gnome-3-26.