Bug 474746 - Wayland: all Gnome apps fonts are rendered without anti-aliasing
Summary: Wayland: all Gnome apps fonts are rendered without anti-aliasing
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.8
Platform: Debian testing Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-20 21:47 UTC by Mau
Modified: 2023-11-01 17:33 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.9


Attachments
Evolution - Example of the issue (50.94 KB, image/png)
2023-09-20 21:52 UTC, Mau
Details
Evolution - Issue fixed by adding "gtk" to the default key in kde-portals.conf (74.03 KB, image/png)
2023-09-20 21:53 UTC, Mau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mau 2023-09-20 21:47:01 UTC
SUMMARY
Since xdg-desktop-portal-kde v5.27.8 in Wayland sessions all GTK3 applications have ugly fonts without anti-aliasing and badly scaled; when launched in the Gnome DE, the same applications' fonts look perfect.

STEPS TO REPRODUCE
1. launch startplasma-wayland
2. open a GTK3 app such as Unison or Evolution

OBSERVED RESULT
Fonts in the GTK3 app appear badly scaled and not anti-aliased at all.

EXPECTED RESULT
Fonts should appear smooth, correctly anti-aliased and well scaled.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian up-to-date Testing
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
I found 3 possible solutions:
- switch to Plasma/X11: this is a Wayland-specific issue
- revert to xdg-desktop-portal-kde v5.27.7
- in the "[preferred]" group in the /usr/share/xdg-desktop-portal/kde-portals.conf file, change "default" key's value 
  from "kde" to "kde;gtk;"

Thanks
Comment 1 Mau 2023-09-20 21:52:05 UTC
Created attachment 161762 [details]
Evolution - Example of the issue
Comment 2 Mau 2023-09-20 21:53:31 UTC
Created attachment 161763 [details]
Evolution - Issue fixed by adding "gtk" to the default key in kde-portals.conf
Comment 3 David Edmundson 2023-09-20 22:07:48 UTC
Install the GTK portal.
It's a bit unintuitive, but changes are happening elsewhere to address this.
Comment 4 David Edmundson 2023-09-20 22:08:08 UTC
> Issue fixed by adding "gtk" to the default key in kde-portals.conf

or that
Comment 5 Mau 2023-09-20 22:30:14 UTC
(In reply to David Edmundson from comment #3)
> Install the GTK portal.
> It's a bit unintuitive, but changes are happening elsewhere to address this.

It's already installed, it doesn't help.
Comment 6 Timothée Ravier 2023-09-22 15:53:03 UTC
This might be: https://bugzilla.redhat.com/show_bug.cgi?id=2240211
Comment 7 Mau 2023-09-22 17:00:33 UTC
(In reply to Timothée Ravier from comment #6)
> This might be: https://bugzilla.redhat.com/show_bug.cgi?id=2240211

Very likely, and that points to https://github.com/flatpak/xdg-desktop-portal/issues/1017 where the GTK_USE_PORTAL env variable is cited, and I found I had it set to 1: unsetting that solved the issue even with just 'default=kde' in kde-portals.conf.

What remains unclear to me is why that didn't cause the problem in a X11 session.
Comment 8 Timothée Ravier 2023-09-22 18:15:06 UTC
Looks like we're now supposed to set the following to default to KDE and fallback to GTK for "missing" implementations:

```
$ cat /usr/share/xdg-desktop-portal/kde-portals.conf
[preferred]
default=kde;gtk
```
Comment 9 Bug Janitor Service 2023-09-22 18:23:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/231
Comment 10 Timothée Ravier 2023-09-27 17:26:31 UTC
Git commit 93f96d31d14a88b45065a21616135a126131c579 by Timothée Ravier.
Committed on 26/09/2023 at 13:09.
Pushed by ravier into branch 'master'.

data/kde-portals.conf: Fallback to GTK portals for Settings

Add a fallback to the GTK portal for Settings. This makes sure that GTK
apps always get valid fonts and related settings.

See: https://bugzilla.redhat.com/show_bug.cgi?id=2240211
See: https://pagure.io/fedora-kde/SIG/issue/396
See: https://github.com/flatpak/xdg-desktop-portal/issues/1017
See: https://github.com/flatpak/xdg-desktop-portal/issues/1112
See: https://bugs.kde.org/show_bug.cgi?id=474746

M  +1    -0    data/kde-portals.conf

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/93f96d31d14a88b45065a21616135a126131c579
Comment 11 Timothée Ravier 2023-09-29 10:28:07 UTC
Git commit 33f8d622559a59fa01e4099f5623af7d001de549 by Timothée Ravier.
Committed on 27/09/2023 at 19:32.
Pushed by ravier into branch 'Plasma/5.27'.

data/kde-portals.conf: Fallback to GTK portals for Settings

Add a fallback to the GTK portal for Settings. This makes sure that GTK
apps always get valid fonts and related settings.

See: https://bugzilla.redhat.com/show_bug.cgi?id=2240211
See: https://pagure.io/fedora-kde/SIG/issue/396
See: https://github.com/flatpak/xdg-desktop-portal/issues/1017
See: https://github.com/flatpak/xdg-desktop-portal/issues/1112
See: https://bugs.kde.org/show_bug.cgi?id=474746

See: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/231
(cherry picked from commit 93f96d31d14a88b45065a21616135a126131c579)

M  +1    -0    data/kde-portals.conf

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/33f8d622559a59fa01e4099f5623af7d001de549
Comment 12 Eugene Shalygin 2023-10-03 13:10:06 UTC
The fix does not work for me with 5.27.8. My /usr/share/xdg-desktop-portal/kde-portals.conf:
[preferred]
default=kde;gtk;
org.freedesktop.impl.portal.Settings=kde;gtk;

Restarted the plasma-xdg-desktop-portal-kde service and yet all GTK apps render fonts without anti-aliasing, use wrong cursor theme, etc. The only workaround is to set GTK_USE_PORTAL=0.
Comment 13 Eugene Shalygin 2023-10-03 13:13:13 UTC
Also, Firefox can't display content when GTK_USE_PORTAL=1, page loading indicator spins infinitely.
Comment 14 Eugene Shalygin 2023-10-03 13:22:20 UTC
Opps, had to restart the xdg-desktop-portal service, not the kde one.
Comment 15 Pellaeon Lin 2023-11-01 05:30:19 UTC
I would like to provide some more sympton to people who might be facing the same issue.

For me, other than having the same sympton in gnome apps, this issue also affects Firefox (non snap version from here https://launchpad.net/~mozillateam/+archive/ubuntu/ppa ).

With Firefox, I observe the following sympton:
- Antialiasing looks OK, but interface fonts (including the tabs bar, url bar, menu, but not the webpage content) are ~150% size of KDE apps
- There is no Maximize and Minimize window buttons, only Close button
- When mouse cursor is within the Firefox window, it is ~150% larger in size, when moved outside the window, cursor returns to normal size

The suggested fix of editing kde-portals.conf works.

Note: this issue appeared for me on my upgrade from Kubuntu 23.04 to 23.10.