[snap] Various UI and theming issues when running in Plasma Wayland session

Bug #1959027 reported by Jan Rathmann
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Unknown
Unknown
firefox (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Hello,

after installing the current live image of Kubuntu Jammy, I tested the preinstalled Firefox snap on the Plasma Wayland session (which I use by default), and discovered multiple UI and theming issues:

1. I had switched my global theme to Breeze Dark. Nevertheless Firefox used a light theme when I launched it for the first time. Interestingly, at further runs Firefox properly came up with a dark theme. But I had restarted my session in between and also had removed and reinstalled the Firefox snap, so it's possible that one of these actions triggered Firefox to finally use a dark theme.

2. The font size in the UI is too big (compare with other KDE apps on screenshots).

3. It apparently doesn't use Breeze (light or dark) as the UI theme, but something else (Adwaita I guess).

4. The mouse cursor uses the wrong theme and is too big (it changes visible if move the cursor in and out of the Firefox window).

5. If I click e.g. on "File -> Open file...", the file dialog is not the one from KDE but the one from GTK/Gnome. And the UI text is displayed in a rather jagged/distorted way (see screenshot).

The issues described above do _not_ appear:
* If I run Firefox as snap in Plasma X11 session.
* If I run Firefox as deb (both Plasma Wayland and X11 session work fine).

Kind regards, Jan

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: firefox 96.0.2+build1-0ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-17.17-generic 5.15.12
Uname: Linux 5.15.0-17-generic x86_64
AddonCompatCheckDisabled: False
ApportVersion: 2.20.11-0ubuntu75
Architecture: amd64
BuildID: 20220119190439
CasperMD5CheckResult: pass
Channel: Unavailable
CurrentDesktop: KDE
Date: Tue Jan 25 17:19:38 2022
DefaultProfileExtensions: extensions.sqlite corrupt or missing
DefaultProfileIncompatibleExtensions: Unavailable (corrupt or non-existant compatibility.ini or extensions.sqlite)
DefaultProfileLocales: extensions.sqlite corrupt or missing
DefaultProfilePrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/firefox/omni.ja:greprefs.js:365
DefaultProfileThemes: extensions.sqlite corrupt or missing
ForcedLayersAccel: False
InstallationDate: Installed on 2022-01-25 (0 days ago)
InstallationMedia: Kubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220125.1)
IpRoute:
 default via 192.168.178.1 dev enp4s0 proto dhcp metric 100
 169.254.0.0/16 dev enp4s0 scope link metric 1000
 192.168.178.0/24 dev enp4s0 proto kernel scope link src 192.168.178.44 metric 100
Profile0Extensions: extensions.sqlite corrupt or missing
Profile0IncompatibleExtensions: Unavailable (corrupt or non-existant compatibility.ini or extensions.sqlite)
Profile0Locales: extensions.sqlite corrupt or missing
Profile0PrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/firefox/omni.ja:greprefs.js:365
Profile0PrefSources: prefs.js
Profile0Themes: extensions.sqlite corrupt or missing
Profiles:
 Profile1 (Default) - LastVersion=None/None (Out of date)
 Profile0 - LastVersion=96.0.2/20220119190439
RunningIncompatibleAddons: False
SourcePackage: firefox
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/18/2009
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F14
dmi.board.name: P35-DS3
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF14:bd06/18/2009:svnGigabyteTechnologyCo.,Ltd.:pnP35-DS3:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnP35-DS3:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:sku:
dmi.product.name: P35-DS3
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
Jan Rathmann (kaiserclaudius) wrote :
Revision history for this message
Jan Rathmann (kaiserclaudius) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

I can confirm most of these issues, after testing in a Kubuntu 22.04 VM, with a Wayland session:

The issue with the font size (2) might be caused by the use of the incorrect theme (3). The firefox deb reports in about:support that the system theme is "Breeze / Adwaita-dark", whereas the snap reports "Adwaita / Adwaita".

The problem with the mouse cursor theme is that the gtk-common-themes snap doesn't include Kubuntu's default cursor theme.

Dialogs to open files are really ugly indeed.

summary: - Various UI and theming issues in Firefox snap when running in Plasma
- Wayland session
+ [snap] Various UI and theming issues when running in Plasma Wayland
+ session
tags: added: snap
Changed in firefox (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote :

Would you mind filing a bug at https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes%7CFirefox with all this information? We're using the upstream bug tracker to manage firefox snap bugs. Thanks!

Revision history for this message
Jan Rathmann (kaiserclaudius) wrote : Re: [Bug 1959027] Re: [snap] Various UI and theming issues when running in Plasma Wayland session

Am 04.02.22 um 12:51 schrieb Olivier Tilloy:
> Would you mind filing a bug at
> https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes%7CFirefox with all
> this information? We're using the upstream bug tracker to manage firefox
> snap bugs. Thanks!
>

Ok, I can do that. Thanks for investigating!

Revision history for this message
In , Jan Rathmann (kaiserclaudius) wrote :

Created attachment 9262422
Screenshot 1: Wrong theme, UI font too big

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

I initially filed this bug on Launchpad and was encouraged to open a report on the Mozilla bug tracker. Link to my original report:
https://bugs.launchpad.net/bugs/1959027

1. Install Kubuntu 22.04 daily-live image (Firefox ships as Snap)
2. On login screen of SDDM (Display manager), select "Plasma (Wayland Session)"
3. In Plasma Systemsettings, switch Global Theme to "Breeze Dark"
4. Launch Firefox (with fresh profile)

Actual results:

1. Firefox uses a light theme instead of a dark one, logging out and in again is required to make Firefox use a dark theme.
2. Font size of the UI elements is too big.
3. Wrong GTK theme is used (Adwaita, instead of Breeze Dark).
4. Mouse cursor uses wrong theme and is too big (it changes, when moving in and out of the Firefox window).
5. Wrong file dialogs (e.g. 'File -> Open...') are used (from GTK instead of KDE). UI text in file dialogs is rendered in a strange jagged/distorted way.

(Screenshots attached)

Expected results:

1. Firefox should immediately use the dark theme without requiring to log out and in again.
2. Font size of UI elements should be the same as on all other applications.
3. Firefox should use Breeze Dark (or Light) as GTK theme on Plasma.
4. The mouse cursor should look the same as in all other applications.
5. Firefox should use KDE file dialogs (without jagged/distorted font rendering).

None of these issues happen:
* When I run Firefox as Snap in Plasma X11 session.
* When I run Firefox as Deb (both Plasma Wayland and X11 session work fine).
So it seems to be specific to running the Firefox Snap under Plasma Wayland session.

Revision history for this message
In , Jan Rathmann (kaiserclaudius) wrote :

Created attachment 9262423
Screenshot 2: GTK File dialog with distorted fonts

Changed in firefox:
status: Unknown → New
Revision history for this message
In , Emilio (emiliocobos) wrote :

Does this work on the nightly? I would expect bug 1734934 to have fixed this.

Revision history for this message
In , Jan Rathmann (kaiserclaudius) wrote :

(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)
> Does this work on the nightly? I would expect bug 1734934 to have fixed this.

Two of the issues seem to be fixed in nightly:
1. Dark theme is now correctly enabled without requiring a session restart first.
5. Firefox correctly uses KDE file dialogs now (with correctly rendered fonts!)

The following three issues remain unchanged:
2. Font size of the UI elements is too big.
3. Wrong GTK theme is used (Adwaita, instead of Breeze Dark).
4. Mouse cursor uses wrong theme and is too big (it changes, when moving in and out of the Firefox window).

I installed nightly by running 'snap refresh --edge firefox'.

Revision history for this message
In , Emilio (emiliocobos) wrote :

Does that happen with other GTK apps ran via snap? I don't think we have control about the GTK theme in use.

Revision history for this message
In , Jan Rathmann (kaiserclaudius) wrote :

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
> Does that happen with other GTK apps ran via snap? I don't think we have control about the GTK theme in use.

Interesting, I tested two other GTK3 apps via snap (Inkscape and eog):
* when running under Plasma Wayland, they also used the "wrong" GTK theme (Adwaita instead of Breeze), just like Firefox. And they had the same ugly font rendering like in the GTK file dialog on my screenshot.
* on Plasma X11, all three apps (Inkscape, eog and Firefox) correctly used Breeze as GTK theme!

So it seems to me there is a general issue in Snap when running GTK3 apps under Plasma Wayland, which also affects Firefox.

Revision history for this message
In , Emilio (emiliocobos) wrote :

I see. In that case, I think the remaining issues should be reported to KDE or Canonical (not sure where does the culprit live).

Might be worth starting with canonical since it seems snap-specific, but on the other hand this seems specific to snap-on-plasma-on-wayland... Vlad, Olivier, do you have thoughts on where could the root cause here live?

Keeping open for tracking for now, but chances are there is little we can do here on Firefox's side.

Changed in firefox:
status: New → Confirmed
Revision history for this message
In , Vlad-zahorodnii (vlad-zahorodnii) wrote :

Not sure what the problem is, gtk apps refuse to use correct theme and font settings on wayland. As far as I know, it can be worked around by installing gtk xdg desktop portal.

Revision history for this message
In , Jan Rathmann (kaiserclaudius) wrote :

Vlad, thanks for the hint! The xdg-desktop-portal-gtk package was not installed on my Jammy test system. After installing it, all three remaing UI issues (wrong theme, wrong cursor, wrong font size) seem to be fixed!

So it would help, at least on Kubuntu, if the xdg-desktop-portal-gtk package was installed by default.

Revision history for this message
In , Olivier Tilloy (osomon) wrote :

Thanks for testing and confirming Jan.
I have filed https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1960220 to request kubuntu to install xdg-desktop-portal-gtk by default.

I think it is now safe to close this bug.

Revision history for this message
In , Emilio (emiliocobos) wrote :

Thanks all!

Revision history for this message
In , Rik Mills (rikmills) wrote :

Should be fixed in K/Ubuntu when this hits the release pocket:

https://launchpad.net/ubuntu/+source/kubuntu-meta/1.416

Changed in firefox:
status: Confirmed → Unknown
Revision history for this message
In , Dan (dan7960) wrote :

This has not fixed the bug. GTK snap and flatpak apps still refuse to use the correct theme and font settings in a plasma Wayland session with xdg-desktop-portal-gtk installed. Tested on Kubuntu 23.10.

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.