Ugly fonts when using fractional scaling on Wayland
While investigating issue #2128 (closed) 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 <llandwerlin@gmail.com>
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 <llandwerlin@gmail.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
Expected result:
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).
Actual result:
The scale factor of the window does not change.
Additional data
As far as I can see, this does not affect gtk4.