Ugly fonts when using fractional scaling on Wayland
While investigating issue gtk#2128 I noticed the fonts where ugly, not rendered correctly, as if scaled incorrectly:
It turns out it is not related to the xdg-output shenanigans, but instead another commit:
commit 6d545b6d03caba8e7718a73c6e0abe35a4133fe0 Author: Lionel Landwerlin <firstname.lastname@example.org> Date: Sat Aug 3 22:31:53 2019 +0300 gdk/wayland: go through monitor to compute scale factor The current code only goes through the output associated to the window's wayland surface enter/leave events. That means that to update the scale factor the window only looks at the outputs on which it received enter/leave events. That doesn't include a new monitor connected to the system on which the window might be display next. The spirit of the existing logic seems to be to go through all the scale factor available on the current monitors of the system and pick the highest. So fix the current behavior by looking at the monitor on the display. Fixes #1144. Signed-off-by: Lionel Landwerlin <email@example.com>
Reverting that commit fixes the issue for me.
Steps to reproduce on a dual screen setup:
- Save and compile the attached simple reproducer: screensize.c
- Enable fractional scaling in mutter (Add 'scale-monitor-framebuffer' to org.gnome.mutter 'experimental-features')
- Set a fractional scale on only one output
- Run the reproducer
When moving from one monitor to the other (of different scale), the scale of the window (as indicated in the title bar of the reproducer window) should change (from scale 1 to scale 2 and vice versa, adapting to the monitor scale).
The scale factor of the window does not change.
As far as I can see, this does not affect gtk4.