Closed Bug 1753732 Opened 3 years ago Closed 3 years ago

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

Categories

(Core :: Widget: Gtk, defect)

Firefox 96
x86_64
Linux
defect

Tracking

()

RESOLVED MOVED

People

(Reporter: jan.rathmann, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

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.
Has STR: --- → yes
Component: Untriaged → Widget: Gtk
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86_64

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

Flags: needinfo?(jan.rathmann)

(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.
  2. 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'.

Flags: needinfo?(jan.rathmann)

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

(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.

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.

Blocks: snap, gtk-kde
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(vlad.zahorodnii)
Flags: needinfo?(olivier)

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.

Flags: needinfo?(vlad.zahorodnii)

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.

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.

Flags: needinfo?(olivier)

Thanks all!

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → MOVED

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

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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: