Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font is not antialiased with GTK apps on wayland #2861

Closed
ghost opened this issue Apr 27, 2019 · 166 comments
Closed

Font is not antialiased with GTK apps on wayland #2861

ghost opened this issue Apr 27, 2019 · 166 comments

Comments

@ghost
Copy link

ghost commented Apr 27, 2019

Linux distribution and version

Linux 5.0.9-arch1-1-ARCH x86_64

Flatpak version

Flatpak 1.3.2

Description of the problem

When using GTK Apps on wayland with flatpak the fonts are not antialiesed (I assume, see Screenshots).

When run with flatpak run --socket=x11 --env=GDK_BACKEND=x11 org.gnome.Recipes it looks like the following:
Screenshot_2019-04-27-11:24:11

When run with flatpak run --socket=wayland --env=GDK_BACKEND=wayland org.gnome.Recipes it looks like the following:

Screenshot_2019-04-27-11:25:43

I am using sway.
The issue also appears on weston.

Steps to reproduce

Start any GTK3+ App in an wayland session.

Workaround

As @AdrianVovk found out you have to have to have some GTK Schemas on your computer.
They should usually be installed by installing gnome-settings-daemon.

@matthiasclasen
Copy link
Collaborator

Depends on what kind of session is running.

If you are using X, gtk will get font settings via xsettings, which will come from a gnome-settings-daemon or some other xsettings manager implementation.

If you are using Wayland and have a new enough gtk in the runtime, gtk will get font settings from the settings portal, which in turn will get them from gsettings (in GNOME) or from a native backend (in KDE).

@refi64
Copy link
Collaborator

refi64 commented Apr 27, 2019

This is actually interesting, I had run into something similar and had done some research into it. What I found was:

  • Only certain fonts are affected, e.g. Noto Sans looks great but Roboto looks terrible, Cantarell is fine but Google Sans looks terrible.
  • At least for me, in e.g. Fractal, the spacing also gets massively messed up.

These two led me to believe the issue could be related to fontconfig somehow as well, but I never had to time to research it at the moment and just ended up switching my fonts to work around it.

@matthiasclasen
Copy link
Collaborator

Could also be fontconfig configuration, yes

@ghost
Copy link
Author

ghost commented Apr 28, 2019

If you are using Wayland and have a new enough gtk in the runtime, gtk will get font settings from the settings portal, which in turn will get them from gsettings (in GNOME) or from a native backend (in KDE).

In $HOME/.config/gtk-3.0 are no files and $HOME/.config/gtkrc is empty. Are there any other gsettings config files I don't know of?
But still:

  • GTK3 Apps installed via pacman render the fonts just right on wayland
  • GTK3 Apps installed via flatpak should be able to grab the same configs as native apps do, or shouldn't they?

These two led me to believe the issue could be related to fontconfig somehow as well

I'll dig into fontconfig and gsettings when I have time and try your mentioned fonts.

@matthiasclasen
Copy link
Collaborator

gsettings are stored in dconf

@ghost
Copy link
Author

ghost commented Apr 30, 2019

It kind of seems like a fontconfig error but at the same time it doesn' t.
When disabeling anti-aliasing it is properly disabled in all wayland (and X) applications that do not run in flatpak.
But explicitly enabeling (it should be enabeled by default) does not help either.

Also I can confirm that the issue only occurs on GTK since Quaternion which is QT based works.

@AdrianVovk
Copy link
Contributor

Any idea how to resolve this? It's getting annoying and tiring to look at.

@AdrianVovk
Copy link
Contributor

Okay I looked into GTK's source code. GTK is using gsettings to retrieve antialiasing from org.gnome.settings-daemon.plugins.xsettings. I noticed that @Marteon is not using gnome-session and has tested Sway and Weston. I'm experiencing this issue with Wayfire. I suspect that because org.gnome.settings-daemon.<whatever> doesn't exist on our systems, GTK defaults to turn off all font niceties it can

Now, @refi64 puts a bit of a hole in my theory, since I know he uses GNOME. However, his seems to be a different problem; maybe his system really does have some messed up fontconfig setup? In my case, any and all fonts are broken, and he's been working around by changing fonts.

I'll open another issue on gtk's git and see if they can confirm/fix it

@matthiasclasen
Copy link
Collaborator

that is not quite correct, no. If you are using X, gtk is getting font settings via xsettings from an xsettings manager, such as gnome-settings-daemon (but there are others). If you are using wayland, older GTK is using gsettings directly (which in turn requires holes in the sandbox for dconf, to work), while new GTK will talk to the settings portal, if you have it.

@AdrianVovk
Copy link
Contributor

AdrianVovk commented May 20, 2019

@matthiasclasen Which keys exactly is it reading? I see it trying to read (through gsettings, looking at GTK's master) the gnome-settings-daemon keys, and since I don't have those installed I assume it doesn't work.

@matthiasclasen
Copy link
Collaborator

lets establish some basics: X or Wayland ? What GTK version in the sandbox ? What xdg-desktop-portal version on the host ?

@AdrianVovk
Copy link
Contributor

@matthiasclasen

  • Wayland
  • GTK+ 3.24.8
  • xdg-desktop-portal 1.2.0

@AdrianVovk
Copy link
Contributor

@matthiasclasen Just to confirm that the issue is what I think it is, I copied over this into ~/.local/share and compiled the schema. A quick reboot and all of the fonts are smooth again.

@matthiasclasen
Copy link
Collaborator

What does

gdbus call --session --dest org.freedesktop.portal.Desktop --object-path /org/freedesktop/portal/desktop --method org.freedesktop.portal.Settings.ReadAll \[\"org.gnome.settings-daemon.plugins.xsettings\"\]

say ?

@AdrianVovk
Copy link
Contributor

@matthiasclasen Without the schema I copied over installed?

@matthiasclasen
Copy link
Collaborator

matthiasclasen commented May 20, 2019

You can run it on the host, but running it in the sandbox will give the same results. And the schema should not affect it one way or the other.

@AdrianVovk
Copy link
Contributor

Here's the output with the schema installed (working antialias):

({'org.gnome.settings-daemon.plugins.xsettings': {'rgba-order': <'rgb'>, 'disabled-gtk-modules': <@as []>, 'antialiasing': <'grayscale'>, 'enabled-gtk-modules': <@as []>, 'overrides': <@a{sv} {}>, 'hinting': <'slight'>}},)

Here's the output without the schema installed (broken antialias):

(@a{sa{sv}} {},)

@AdrianVovk
Copy link
Contributor

AdrianVovk commented May 20, 2019

@matthiasclasen I just saw your comment on the issue I posted for GTK. My issue isn't that the portal is broken. My issue is that I don't have gnome-settings-daemon installed on my system because I don't use gnome-shell. It turns out that even though GTK reads the antialias settings from gsettings (through the settings portal), the schema is installed by gnome-settings-daemon, not gnome-desktop-schemas or gtk itself. Because I don't have the schema installed, gtk cannot read any antialiasing settings, and so it defaults to turning everything off. This is why I opened the issue on GTK's git. I think GTK needs to run properly without g-s-d

@matthiasclasen
Copy link
Collaborator

matthiasclasen commented May 21, 2019

The portal will use a backend instead of reading gsettings directly, if one is available. Kde has one. It seems we are coming to the conclusion that your desktop, whatever it is, needs one too.

@AdrianVovk
Copy link
Contributor

AdrianVovk commented May 21, 2019

@matthiasclasen My desktop is custom, and it's entirely GTK based. Think of elementary's Pantheon or Solus' budgie. The difference is that I have my own wlroots-based Wayland compositor

As I see it, GTK shouldn't depend on gnome-settings-daemon for critical options like this; they are part of the toolkit and not the session/environment.

If GTK doesn't fix this, I'll just have a custom schema that provides the parts of gnome-settings-daemon that GTK needs. It would be preferable that GTK handled fonts independently of gnome-shell, however.

Edit:
I say this flatpak issue can be closed, since it's no longer an issue with flatpak. It's an issue with GTK itself that flatpak exposed.

@refi64
Copy link
Collaborator

refi64 commented May 21, 2019

My font configuration is the standard out-of-the-box Fedora config, I doubt it's anything weird on that end.

@matthiasclasen
Copy link
Collaborator

There's various options for improving the situation, in varying degrees of effort, practicality, and likeliness:

  • Invent a 'neutral' cross-desktop settings standard
  • Duplicate the exiting schemas in a gtk namespace
  • Move settings-daemon schemas to gsettings-desktop-schemas
  • In the absence of a backend and schemas, make the portal hardcode schema defaults

@AdrianVovk
Copy link
Contributor

AdrianVovk commented May 21, 2019

@matthiasclasen

  • Too much effort and unlikely
  • Some effort but seems like the cleanest solution
  • Simple & gets the job done. Probably the best option for everyone
  • This already happens; the defaults that are hardcoded are the bad ones. Plus, the schemas define the defaults. I don't see how this would be implemented well, if at all

@sentriz
Copy link

sentriz commented Sep 13, 2019

i'm experiencing this too. with for example org.gnome.Boxes on sway

@ghost
Copy link
Author

ghost commented Sep 13, 2019

@AdrianVovk can you post a link to the issue you opend at GTK?

I'll close the issue when you posted the link.

@psnszsn
Copy link

psnszsn commented Sep 14, 2019 via email

@ghost
Copy link
Author

ghost commented Sep 14, 2019

@psnszsn In the issue I edited in a workaround. Thanks!

@AdrianVovk
Copy link
Contributor

@Marteon IIRC it isn't gsettings-desktop-schemas. It's the schemas installed by gnome-settings-daemon

@ghost
Copy link
Author

ghost commented Sep 14, 2019

@AdrianVovk Fixed it!

@sentriz
Copy link

sentriz commented Sep 14, 2019

hmm my system already has gsettings-desktop-schemas installed but experiencing this still.

here are the files

@Viktini
Copy link

Viktini commented Feb 1, 2024

Happens to me with Bottles on Arch Linux, KDE Wayland. Changing to X11 fixes it, installing gnome-settings-daemon does nothing.

@sr-tream
Copy link

sr-tream commented Feb 1, 2024

Happens to me with Bottles on Arch Linux, KDE Wayland. Changing to X11 fixes it, installing gnome-settings-daemon does nothing.

You can unset variable GTK_USE_PORTAL or set it to 0 for applications with broken fonts. In "Bottles" case, it continues to use portal dialogs, but fonts is ok.

@vivantart
Copy link

vivantart commented Feb 1, 2024

Guys, try this:

Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;

then:
systemctl --user restart xdg-desktop-portal
systemctl --user restart xdg-desktop-portal-gtk

@tajeraich
Copy link

Guys, try this:

Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;

then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

This is the only thing that worked for me, or maybe it was a combination of multiple things. I literally tried every other suggestion on this page.

@vivantart
Copy link

Guys, try this:
Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;
then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

This is the only thing that worked for me, or maybe it was a combination of multiple things. I literally tried every other suggestion on this page.

Well, I bet that is what really fixed. You can try it on a fresh install and it will work (yes, I tested with a few distros and only those lines are needed to fix this annoying thing).

@Megalomaniak
Copy link

Guys, try this:

Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;

then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

Alas, doesn't work on Manjaro KDE plasma-wayland.

@vivantart
Copy link

Guys, try this:
Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;
then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

Alas, doesn't work on Manjaro KDE plasma-wayland.

Good to know! Maybe on Manjaro/Arch or even Fedora there are different steps? I tried only with debian based distros.
If anyone here know why doesn't work on these distros, please let us know!

@Megalomaniak
Copy link

Maybe on Manjaro/Arch or even Fedora there are different steps?

I think it's something to do with the necessary GTK config file being missing by default.

@uncharted-user
Copy link

I am still experiencing this on openSUSE leap 15.5 Gnome 41.8,
font_firefox

@sr-tream
Copy link

Guys, try this:
Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;
then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

Alas, doesn't work on Manjaro KDE plasma-wayland.

Good to know! Maybe on Manjaro/Arch or even Fedora there are different steps? I tried only with debian based distros. If anyone here know why doesn't work on these distros, please let us know!

For Arch, your fix is a default config and it works:

[preferred]
default=kde
org.freedesktop.impl.portal.Settings=kde;gtk;

@elvindesouza
Copy link

Guys, try this:

Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;

then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

Works on Kubuntu 23.10 running KDE Plasma 5.27.8. Related bug tracker
libgtk4 4.12.3+ds-1ubuntu0.1
libgtk3 3.24.38-5ubuntu1
libgtk2 2.24.33-2ubuntu2

@muizzsiddique
Copy link

Guys, try this:

Edit /usr/share/xdg-desktop-portal/kde-portals.conf and add org.freedesktop.impl.portal.Settings=kde;gtk;

then: systemctl --user restart xdg-desktop-portal systemctl --user restart xdg-desktop-portal-gtk

Once I ran the last command I found out xdg-desktop-portal-gtk wasn't even installed on my Arch. I installed it and now font smoothing is back. This was the issue.

@variousinputs
Copy link

Once I ran the last command I found out xdg-desktop-portal-gtk wasn't even installed on my Arch. I installed it and now font smoothing is back. This was the issue.

Seconded. The config file was already correct for me but my Arch installation was missing xdg-desktop-portal-gtk. Wasn't an issue with KDE 5, but with the new release of KDE 6 I noticed aliasing was messed up. This fixed it! Thanks to both of you!

@chrisawi
Copy link
Collaborator

I've just done a bit of a deep dive, and I can't understand how anyone could still be hitting this, even if xdg-desktop-portal-gtk (or -gnome) isn't installed. For both GTK4 and GTK3, having no settings portal at all should work via the default values set in gsettings-desktop-schemas (inside the sandbox, not on the host) since 2020. If the settings portal is present, but the gtk keys are missing (e.g. if only xdg-desktop-portal-kde is available), GTK has had useful hardcoded fallback values since 2021.

If anyone has a GTK flatpak app with non-antialiased text like in the second screenshot in the issue description, please provide specific details. Otherwise, I think it's long past time to close this.

In addition to basic information like which apps are affected, I'd like to see the output of /usr/libexec/xdg-desktop-portal -rv. Please confirm that the app is still broken if launched while that command is running.

flatpak info -M <APP_ID> would also be helpful.

@variousinputs
Copy link

@chrisawi I can always try to uninstall xdg-desktop-portal-gtk and starting the flatpak I noticed this in. It was dbeaver. I think it coincided with the KDE 6 update. I never had an issue before that.

Let me know if you'd like me to do that. I can provide any info you'd want. Otherwise, you can mark it as solved since installing xdg-desktop-portal-gtk fixed my issue. Thanks!

@chrisawi
Copy link
Collaborator

I can always try to uninstall xdg-desktop-portal-gtk and starting the flatpak I noticed this in. It was dbeaver. I think it coincided with the KDE 6 update. I never had an issue before that.

io.dbeaver.DBeaverCommunity? I can't reproduce the issue by intentionally sabotaging the settings portal (two different ways) on GNOME, so yes if that app is non-antialiased with xdg-desktop-portal-gtk uninstalled, I'd like to see that information.

You can also run G_MESSAGES_DEBUG=Gdk flatpak run io.dbeaver.DBeaverCommunity and look for a line like:

Using portal setting for org.gnome.desktop.interface font-antialiasing: 'grayscale'

just to rule out the unlikely possibility that you have some other portal implementation providing an incorrect value.

@Megalomaniak
Copy link

Megalomaniak commented Mar 31, 2024

Only XDG-Desktop-Portal and XDG-Desktop-Portal-KDE are installed. Flatseal(open image in new tab for full res):

FlatSealNoAA

@chrisawi
Copy link
Collaborator

@Megalomaniak OK, so it's still happening for you. Can you provide this?:

I'd like to see the output of /usr/libexec/xdg-desktop-portal -rv. Please confirm that the app is still broken if launched while that command is running.

flatpak info -M <APP_ID> would also be helpful.

Also, what distro, etc?

@WhyNotHugo
Copy link

WhyNotHugo commented Mar 31, 2024

If anyone has a GTK flatpak app with non-antialiased text like in the second screenshot in the issue description, please provide specific details. Otherwise, I think it's long past time to close this.

This issue is still around for me, but I'm not sure what other details I can provide. I have no special setup on the host. I can reproduce this with com.github.tchx84.Flatseal (2.1.1).

Verbose logs for the portal:

> /usr/libexec/xdg-desktop-portal -rv
XDP: Looking for portals configuration in '/home/hugo/.config/xdg-desktop-portal/portals.conf'
XDP: Preferred portals for interface 'org.freedesktop.impl.portal.ScreenCast': wlr
XDP: Preferred portals for interface 'org.freedesktop.impl.portal.Screenshot': wlr
XDP: Preferred portals for interface 'org.freedesktop.impl.portal.Settings': darkman
XDP: Using portal configuration file '/home/hugo/.config/xdg-desktop-portal/portals.conf' for non-specific desktop
XDP: load portals from /usr/share/xdg-desktop-portal/portals
XDP: loading /usr/share/xdg-desktop-portal/portals/wlr.portal
XDP: portal implementation supports org.freedesktop.impl.portal.Screenshot
XDP: portal implementation supports org.freedesktop.impl.portal.ScreenCast
XDP: loading /usr/share/xdg-desktop-portal/portals/darkman.portal
XDP: portal implementation supports org.freedesktop.impl.portal.Settings
XDP: providing portal org.freedesktop.portal.MemoryMonitor
XDP: providing portal org.freedesktop.portal.PowerProfileMonitor
XDP: providing portal org.freedesktop.portal.NetworkMonitor
XDP: providing portal org.freedesktop.portal.ProxyResolver
XDP: providing portal org.freedesktop.portal.Trash
XDP: providing portal org.freedesktop.portal.GameMode

(/usr/libexec/xdg-desktop-portal:14372): xdg-desktop-portal-WARNING **: 10:42:40.159: Failed to load RealtimeKit property: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.RealtimeKit1 was not provided by any .service files

(/usr/libexec/xdg-desktop-portal:14372): xdg-desktop-portal-WARNING **: 10:42:40.160: Failed to load RealtimeKit property: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.RealtimeKit1 was not provided by any .service files

(/usr/libexec/xdg-desktop-portal:14372): xdg-desktop-portal-WARNING **: 10:42:40.160: Failed to load RealtimeKit property: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.RealtimeKit1 was not provided by any .service files
XDP: providing portal org.freedesktop.portal.Realtime
XDP: Found 'darkman' in configuration for org.freedesktop.impl.portal.Settings
XDP: Using darkman.portal for org.freedesktop.impl.portal.Settings (config)
XDP: providing portal org.freedesktop.portal.Settings
XDP: Found 'wlr' in configuration for org.freedesktop.impl.portal.ScreenCast
XDP: Using wlr.portal for org.freedesktop.impl.portal.ScreenCast (config)
XDP: providing portal org.freedesktop.portal.ScreenCast
XDP: org.freedesktop.portal.Desktop acquired
XDP: Read org.freedesktop.appearance color-scheme
XDP: Read org.freedesktop.appearance color-scheme
XDP: Read org.gnome.desktop.a11y.interface high-contrast
XDP: Failed to Read() from Settings implementation: GDBus.Error:org.freedesktop.portal.Error.NotFound: Requested setting not found
XDP: Attempted to read unknown namespace/key pair: org.gnome.desktop.a11y.interface high-contrast

I used flatseal to reproduce this, but it's reproducible with other GTK apps too.

> flatpak info -M com.github.tchx84.Flatseal
[Context]
shared=ipc;
sockets=x11;wayland;fallback-x11;
devices=dri;
filesystems=xdg-data/flatpak/overrides:create;/var/lib/flatpak/app:ro;xdg-data/flatpak/app:ro;

[Session Bus Policy]
org.gnome.Software=talk
org.freedesktop.impl.portal.PermissionStore=talk

I'm on Alpine Linux Edge on x86_64. I have xdg-desktop-portal-1.18.2-r0 and xdg-desktop-portal-wlr-0.7.1-r0 installed. I also have darkman (of which I am the author) installed. darkman provides the color-prefers settings (e.g.: dark mode / light mode), but the issue reproduces anyway if I remove it from the equation.

Settings:

> cat .config/xdg-desktop-portal/portals.conf 
[preferred]
org.freedesktop.impl.portal.ScreenCast=wlr
org.freedesktop.impl.portal.Screenshot=wlr
org.freedesktop.impl.portal.Settings=darkman

@Megalomaniak
Copy link

Megalomaniak commented Mar 31, 2024

I'd like to see the output of /usr/libexec/xdg-desktop-portal -rv. Please confirm that the app is still broken if launched while that command is running.

/usr/lib/xdg-desktop-portal -rv                                                                                                                                                                    ✔ 
XDP: Looking for portals configuration in '/home/user/.config/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/home/user/.config/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/home/user/.config/kdedefaults/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/home/user/.config/kdedefaults/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/etc/xdg/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/etc/xdg/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/usr/share/manjaro-kde-settings/xdg/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/usr/share/manjaro-kde-settings/xdg/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/etc/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/etc/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/home/user/.local/share/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/home/user/.local/share/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/home/user/.local/share/flatpak/exports/share/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/home/user/.local/share/flatpak/exports/share/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/var/lib/flatpak/exports/share/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/var/lib/flatpak/exports/share/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/usr/local/share/xdg-desktop-portal/kde-portals.conf'
XDP: Looking for portals configuration in '/usr/local/share/xdg-desktop-portal/portals.conf'
XDP: Looking for portals configuration in '/usr/share/xdg-desktop-portal/kde-portals.conf'
XDP: Preferred portals for interface 'default': kde
XDP: Preferred portals for interface 'org.freedesktop.impl.portal.Settings': kde, gtk
XDP: Using portal configuration file '/usr/share/xdg-desktop-portal/kde-portals.conf' for desktop 'kde'
XDP: load portals from /usr/share/xdg-desktop-portal/portals
XDP: loading /usr/share/xdg-desktop-portal/portals/io.elementary.files.portal
XDP: portal implementation supports org.freedesktop.impl.portal.FileChooser
XDP: loading /usr/share/xdg-desktop-portal/portals/kde.portal
XDP: portal implementation supports org.freedesktop.impl.portal.Access
XDP: portal implementation supports org.freedesktop.impl.portal.Account
XDP: portal implementation supports org.freedesktop.impl.portal.AppChooser
XDP: portal implementation supports org.freedesktop.impl.portal.Background
XDP: portal implementation supports org.freedesktop.impl.portal.Email
XDP: portal implementation supports org.freedesktop.impl.portal.FileChooser
XDP: portal implementation supports org.freedesktop.impl.portal.Inhibit
XDP: portal implementation supports org.freedesktop.impl.portal.Notification
XDP: portal implementation supports org.freedesktop.impl.portal.Print
XDP: portal implementation supports org.freedesktop.impl.portal.ScreenCast
XDP: portal implementation supports org.freedesktop.impl.portal.Screenshot
XDP: portal implementation supports org.freedesktop.impl.portal.RemoteDesktop
XDP: portal implementation supports org.freedesktop.impl.portal.Settings
XDP: portal implementation supports org.freedesktop.impl.portal.DynamicLauncher
XDP: portal implementation supports org.freedesktop.impl.portal.GlobalShortcuts
XDP: providing portal org.freedesktop.portal.MemoryMonitor
XDP: providing portal org.freedesktop.portal.PowerProfileMonitor
XDP: providing portal org.freedesktop.portal.NetworkMonitor
XDP: providing portal org.freedesktop.portal.ProxyResolver
XDP: providing portal org.freedesktop.portal.Trash
XDP: providing portal org.freedesktop.portal.GameMode
XDP: providing portal org.freedesktop.portal.Realtime
XDP: Found 'kde' in configuration for org.freedesktop.impl.portal.Settings
XDP: Using kde.portal for org.freedesktop.impl.portal.Settings (config)
XDP: providing portal org.freedesktop.portal.Settings
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.FileChooser (config)
XDP: providing portal org.freedesktop.portal.FileChooser
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.AppChooser (config)
XDP: providing portal org.freedesktop.portal.OpenURI
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Print (config)
XDP: providing portal org.freedesktop.portal.Print
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Notification (config)
XDP: providing portal org.freedesktop.portal.Notification
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Inhibit (config)
XDP: providing portal org.freedesktop.portal.Inhibit
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Access (config)
XDP: providing portal org.freedesktop.portal.Device
XDP: providing portal org.freedesktop.portal.Location
XDP: providing portal org.freedesktop.portal.Camera
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Screenshot (config)
XDP: providing portal org.freedesktop.portal.Screenshot
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Background (config)

(/usr/lib/xdg-desktop-portal:697673): xdg-desktop-portal-WARNING **: 19:27:56.588: Failed to create background monitor: Failed to own background monitor D-Bus name

(/usr/lib/xdg-desktop-portal:697673): xdg-desktop-portal-WARNING **: 19:27:56.588: No skeleton to export
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Account (config)
XDP: using org.freedesktop.impl.portal.Account at org.freedesktop.impl.portal.desktop.kde

XDP: providing portal org.freedesktop.portal.Account
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.Email (config)
XDP: providing portal org.freedesktop.portal.Email
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.GlobalShortcuts (config)
XDP: providing portal org.freedesktop.portal.GlobalShortcuts
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.DynamicLauncher (config)
XDP: providing portal org.freedesktop.portal.DynamicLauncher
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.ScreenCast (config)
XDP: providing portal org.freedesktop.portal.ScreenCast
XDP: Found 'kde' in configuration for default
XDP: Using kde.portal for org.freedesktop.impl.portal.RemoteDesktop (config)
XDP: providing portal org.freedesktop.portal.RemoteDesktop
XDP: org.freedesktop.portal.Desktop acquired

flatpak info -M <APP_ID> would also be helpful.

flatpak info -M io.github.RodZill4.Material-Maker

[Context]
shared=network;ipc;
sockets=wayland;fallback-x11;
devices=dri;
filesystems=home;

Also, what distro, etc?

Oh, it's one of the most magical ones: manjaro /s

@WhyNotHugo
Copy link

Darkman actually logs all the calls to org.freedesktop.impl.portal.Settings.Read which it doesn't know how to handle. These are:

2024-03-31 17:48:29.935184687  portal.go:198: Got request for unknown setting: org.gnome.desktop.wm.preferences button-layout
2024-03-31 18:06:18.040888666  portal.go:198: Got request for unknown setting: org.freedesktop.appearance contrast
2024-03-31 18:06:18.041106730  portal.go:198: Got request for unknown setting: org.gnome.desktop.a11y.interface high-contrast

From what I can tell, no query for anything related to antialiasing is being made.

@chrisawi
Copy link
Collaborator

chrisawi commented Apr 1, 2024

From what I can tell, no query for anything related to antialiasing is being made.

GTK uses ReadAll, so it doesn't request any specific settings by name. If there are no matches for org.gnome.*, it's supposed to fall back to gsettings, but there's a bug preventing that from working: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7090

I wasn't simulating an empty portal response correctly, so I missed it.

@WhyNotHugo
Copy link

https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7090 sounds like it could be the cause of the issue (at least in my scenario and a few others here).

I guess that the only way to confirm is to run some Flatpak application which includes GTK built with that patch, right?

@chrisawi
Copy link
Collaborator

chrisawi commented Apr 2, 2024

I guess that the only way to confirm is to run some Flatpak application which includes GTK built with that patch, right?

You can test it outside of flatpak using GDK_DEBUG=portals, which I have done. I'm confident that this was the last remaining piece, and it was technically never a flatpak bug anyway, so I'm going to go ahead and close the issue.

It will take some time for this to get into a stable release of GTK4; hopefully it will be backported to GTK3 as well.

If anyone wants to verify for themself, they can build gtk from git main and run e.g.:
GDK_DEBUG=portals G_MESSAGES_DEBUG=Gdk builddir/demos/icon-browser/gtk4-icon-browser

@chrisawi chrisawi closed this as completed Apr 2, 2024
@WhyNotHugo
Copy link

Thanks for figuring this one out 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests