dconf overrides are not read by flatpaks on wayland sessions

Bug #1804954 reported by Casey
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
flatpak (Ubuntu)
Invalid
Undecided
Unassigned
xdg-desktop-portal (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

"dconf supports distros installing override files into the system, then when queried dconf will look at user setting, then fallback to distro setting, then fallback to default setting. In a sandbox we can ask dconf for the user setting but we don't have disk access to the override files"

So what this means is that on wayland flatpaks can't read the default overrides from the session (eg Ubuntu choosing Ambiance and Minimise, Maximise, Close etc) as it doesn't have permission to read the system files only user ones. (this doesn't affect X11 sessions as gtk reads from xsettings instead).

This will be solved when the settings portal [0] is used in xdg-desktop-portal, as that runs on the host outside of the sandbox it is able to read the necessary files.

# Workaround

Install gnome-tweaks, change your theme to something else and then back to Ambiance. Also for the window controls change one of them from true to false to true. This will then write user settings to dconf which the flatpak's can then read.

0 - https://github.com/flatpak/xdg-desktop-portal/pull/245

=== Original Description ===

System: Ubuntu 18.04.1
Flatpak version: 1.0.6-flatpak1~bionic (from https://launchpad.net/~alexlarsson/+archive/ubuntu/flatpak)

Description: Flatpaks using GTK3 default to the Adwaita theme in a Wayland Gnome session. In Xorg sesions they are themed correctly. The attached screenshots demonstrate the same version of Gnome Builder running in Communitheme-Wayland and Communitheme-Xorg. However, flatpaks that use Qt5 (like KeepassXC) seem to be themed correctly under Wayland.

Revision history for this message
Casey (casey-jao) wrote :

Gnome Builder (latest) in Communitheme-Wayland session

description: updated
Revision history for this message
Casey (casey-jao) wrote :

Gnome Builder in Communitheme session

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

This seems strange, I have had other themes work on both X11 and Wayland - it could be an app specific issue, a theme issue, a runtime issue, a session issue etc. The fact you state Qt5 apps are working correctly suggests it might be an app/runtime issue.

Can you post the output of the following command, so that we can see which theme extensions are installed ?
$ flatpak list

Could you post the output of the following command in both of the sessions to see which theme it thinks is in use?
$ gtk-query-settings |grep -i gtk-theme

Can you try installing org.gnome.Recipes and try that with both sessions to ensure it isn't an app specific issue.

Until the info above is provided I will mark this bug as incomplete.

Changed in flatpak (Ubuntu):
status: New → Incomplete
Revision history for this message
Casey (casey-jao) wrote :

flatpak list:
org.gtk.Gtk3theme.Communitheme/x86_64/3.22 system,runtime

gtk-query-settings:
gtk-theme-name: "Communitheme"

in both Xorg and Wayland sessions.

Revision history for this message
Casey (casey-jao) wrote :

Gnome Recipes in Wayland

Revision history for this message
Casey (casey-jao) wrote :

Gnome Recipes in Xorg

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Thanks for the extra info!

Could you also try running gtk-query-settings from inside the sandbox when on wayland ? (eg running the following command)
$ flatpak run --command=gtk-query-settings org.gnome.Recipes

Revision history for this message
Casey (casey-jao) wrote :

Under Wayland:

gtk-theme-name: "Adwaita"

Revision history for this message
Casey (casey-jao) wrote :
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Maybe, although it still seems a bit strange - i do wonder if snap and flatpak maybe conflicting somehow. For the communitheme-wayland session did you install that via a snap or PPA ?

Also could you post the full output of the following commands (to pastebin if you prefer) to ensure that we are using the same versions of the app as me and the permissions are correct. Eg are you using the version from flathub or gnome-apps-nightly etc.

$ flatpak list --show-details
$ flatpak remotes --show-details
$ flatpak info org.gnome.Recipes
$ flatpak info --show-permissions org.gnome.Recipes

Revision history for this message
Casey (casey-jao) wrote :

The communitheme session was installed via snap.

flatpak list --show-details
https://pastebin.com/0grq8N9v

flatpak remotes --show-details
https://pastebin.com/zYD4dYSd

flatpak info org.gnome.Recipes
https://pastebin.com/LmtxPkdD

flatpak info --show-permissions org.gnome.Recipes
https://pastebin.com/ZmEH0zsw

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

So you are definitely on the same version as me. I just tried with a virtual machine and was able to reproduce this after installing the communitheme snap session (and using the wayland variant). I will mark this as confirmed for now and discuss this issue with flatpak developers.

Changed in flatpak (Ubuntu):
status: Incomplete → Confirmed
Andrew Hayzen (ahayzen)
summary: - Themes work in Xorg but not Wayland sessions
+ Themes work in Xorg but not Wayland sessions - when using Communitheme
+ snap sessions
Revision history for this message
Casey (casey-jao) wrote : Re: Themes work in Xorg but not Wayland sessions - when using Communitheme snap sessions

Thanks. By the way, the same problem is not unique to the communitheme snap. I can reproduce the problem with the standard Ubuntu-Wayland session (with the default Ubuntu theme), while themes work correctly in the Ubuntu Xorg session.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Hmm I also see this now, I'm pretty sure this worked before. I wonder why this is broken, it seems to be working in Debian Testing. I'll continue investigating, and post anything if I find something...

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

OK after much discussion with flatpak developers and testing things in VMs, we have found the reason this happens on wayland only !

Quote from TingPing, "dconf supports distros installing override files into the system, then when queried dconf will look at user setting, then fallback to distro setting, then fallback to default setting. In a sandbox we can ask dconf for the user setting but we don't have disk access to the override files".

So what this means is that on wayland the flatpak can't read the default overrides from the session (eg Ubuntu choosing Ambiance and Minimise, Maximise, Close) as it doesn't have permission to read the system files only user ones. (this doesn't affect X11 sessions as gtk reads from xsettings instead).

This will be solved when the settings portal [0] is used in xdg-desktop-portal, as that runs on the host outside of the sandbox it is able to read the necessary files.

For now the workaround is to install gnome-tweaks, change your theme to something else and then back to Ambiance. Also for the window controls change one of them from true to false to true. This will then write user settings to dconf which the flatpak's can then read.

As this will be solved in the next version of xdg-deskop-portal, I will close this bug for the flatpak package and open against xdg-desktop-portal.

0 - https://github.com/flatpak/xdg-desktop-portal/pull/245

summary: - Themes work in Xorg but not Wayland sessions - when using Communitheme
- snap sessions
+ dconf overrides are not read by flatpaks on wayland sessions
description: updated
Changed in flatpak (Ubuntu):
status: Confirmed → Invalid
Changed in xdg-desktop-portal (Ubuntu):
status: New → Confirmed
Revision history for this message
Casey (casey-jao) wrote :

Thanks, that workaround does mostly work. However, the window controls still don't look quite right even after disabling and enabling the minimize and maximize buttons in Gnome Tweaks.

Revision history for this message
Casey (casey-jao) wrote :

Correction -- the issue of window controls is not specific to Wayland and perhaps belongs in a separate bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.