Closed Bug 1961468 Opened 1 year ago Closed 1 year ago

Firefox Snap - Color management not working under Wayland

Categories

(Core :: Widget: Gtk, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: ladislav.horvath, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

1./ Installed ICC color profile in Ubuntu 24.04 under default Wayland session
2./ Openned default Firefox Snap browser and go to about:config from URL bar
3./ Specified path to my ICC color profile in "gfx.color_management.display_profile"
4./ Set "gfx.color_management.mode" to "1"

Actual results:

After restart of Firefox Snap, color are still the same, oversaturaded, unmanaged under Wayland session. But it's working as expected under X11 session.

Expected results:

Color management should be workind in Wayland session the same way how it's working under X11 or how it's working in standard Firefox debian package.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: snap
Priority: -- → P3

Just to make sure, have you tried to reproduce outside of a snap package ? Could you also try using core24 base via sudo snap refresh --channel=latest/candidate firefox ?

Flags: needinfo?(ladislav.horvath)

I can confirm its the same on the latest candidate. Under X11 are colors managed, under Wayland are not and.
Using debian package of Firefox, colors are managed under both X11 and Wayland sessions.

Flags: needinfo?(ladislav.horvath)

What is the path you used in gfx.color_management.display_profile ?

Flags: needinfo?(ladislav.horvath)

I have tried path in my home profile and i have also tried to copy ICC profile system wide but it was the same

locally it was /home/usename/.local/share/icc/
system wide it was i think /usr/share/color/icc/colord/

Flags: needinfo?(ladislav.horvath)

(In reply to Ladislav Horvath from comment #5)

I have tried path in my home profile and i have also tried to copy ICC profile system wide but it was the same

locally it was /home/usename/.local/share/icc/

I can't remember out of the top of my head but this might be blocked by snapd

system wide it was i think /usr/share/color/icc/colord/

It's likely that the system wide path might be blocked by snapd

Ideally if you can install snappy-debug and run it while reproducing (I think just starting the browser after having changed the pref would be enough) this should show you the violation and help us verify further. Although it would be weird to work with X11 and not Wayland then.

Flags: needinfo?(ladislav.horvath)

I have copied icc profile to my /home/username/ and from there can Firefox snap access it and use it, so colors are properly managed.

So you are right that propably those paths are blocked by snapd. Question is if this is a bug or only a configuration/packaging thing.

Flags: needinfo?(ladislav.horvath)
Blocks: snap-sandbox
No longer blocks: snap

(In reply to Ladislav Horvath from comment #7)

I have copied icc profile to my /home/username/ and from there can Firefox snap access it and use it, so colors are properly managed.

So you are right that propably those paths are blocked by snapd. Question is if this is a bug or only a configuration/packaging thing.

Unfortunately there's a long tail of similar cases due to snapd limitations. Whether this should be fixed is not a question...

Nathan that's another use case where the addition of paths to snapd does not scale

Flags: needinfo?(nathan.teodosio)

New experimental Ubuntu Security Center might solve this thing. I have turned it on and when i have downloaded some files in Firefox Snap, it asked for permission to read/write to my downloads folder. Sadly when launching Firefox snap, it does not ask for read access to /home/usename/.local/share/icc/ - maybe some detection issue.

https://snapcraft.io/install/desktop-security-center/ubuntu

This app is propably still in alpha/beta and i hope it will improve over time greatly. Currently is not possible to whitelist specific location, like for icc profile or user fontconfig files (also blocked), but later maybe users could add their own custom rules for locations..

After these findings i'm a bit ashamed. I should have done more tests before spamming bugzilla. This is obviously related to strict snap sandboxing and will affect all color managed apps, picture viewers/editors, video players etc. Imho there is nothing Mozilla can fix here..

(In reply to Ladislav Horvath from comment #11)

https://www.omgubuntu.co.uk/2024/09/ubuntus-new-security-center-readies-stable-release

Thanks, I dont remember from the previous issues but this might be a good solution to all those path we cannot realistically add manually

(In reply to Ladislav Horvath from comment #12)

After these findings i'm a bit ashamed. I should have done more tests before spamming bugzilla. This is obviously related to strict snap sandboxing and will affect all color managed apps, picture viewers/editors, video players etc. Imho there is nothing Mozilla can fix here..

Easy to say once we have found the root cause ... For now I'll close as WORKSFORME and this can serve as documentation.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME

It's surely a valid bug report, as you said Security Center is not yet ready and not all currently supported Ubuntu releases have it in the first place so this should be fixed at the snap level.

Dotfiles under the home directory are indeed out of bounds for the snaps. New interfaces can allow that, but they are a last resort measure, so first we could allow access to /usr/share/color/icc/colord. I'm not familiar with the concept of "color profiles" but is that something that each people would be opinionated about and so have one per user, or would allowance to the system-wide path already address the problem?

Flags: needinfo?(nathan.teodosio) → needinfo?(ladislav.horvath)

Also if you could kindly provide a clear-cut verification test, i.e. A instead of B

(A) Pick the background color of Firefox, it should be #DEADBE.

(B) Color management should be workind in Wayland session the same way how it's working under X11 or how it's working in standard Firefox debian package.

that would be much appreciated. But maybe it's not possible, it's OK.

(In reply to Nathan Teodosio :nteodosio from comment #14)

Dotfiles under the home directory are indeed out of bounds for the snaps. New interfaces can allow that, but they are a last resort measure, so first we could allow access to /usr/share/color/icc/colord. I'm not familiar with the concept of "color profiles" but is that something that each people would be opinionated about and so have one per user, or would allowance to the system-wide path already address the problem?

Hello,
If you allow access to '/usr/share/color/icc/colord' it will not help the average user, only experienced users. In that case i would need to launch from terminal 'sudo nautilus' and then copy ICC color profile for my monitor to that location but that would be propably not a prefered solution if users need to access filesystem under root..

ICC color profiles installed by users from GNOME settings (or KDE) are stored in '/home/usename/.local/share/icc/'

Concept of color profiles - Well it's kinda mandatory thing to have them installed if you are using higher quality, semi-profi or fully professional monitor for graphics accurate work. Or simply if you want to have accurate colors as possible on your screen durring browsing, gaming or movies. Not too washed out colors, not too much saturation etc. Specially if you have WCG monitor, you really don't want to look at oversaturated 'radioactive' colors (unless you can switch to sRGB color mode from monitor OSD).

With installed ICC color profile for your monitor, which is part of the Windows driver (as *.ICM file which can be renamed to *.ICC file), with that profile you will get accurate colors in color managed apps like Firefox, Gimp or mplayer and in others. And since Wayland have now proper color management (and HDR) with GNOME 48, you really need to have working this in snap apps. I hope you understand my point why such an important and basic thing must be working in color managed apps. It's as much important as font hinting. Could you imagine that snap apps would not use any kind of font hinting or could not access user fonts?

In my opinion, all snap apps should have read permissions for user profile location where ICC color profiles are stored after import from GNOME settings. That is a no-brainer, even for sandboxed apps. Imagine using snap apps like Gimp without working color management for graphics or photo-editing work. That is.. well.. not optimal to say at least.

Same for Firefox, it's really important to have accurate colors when browsing the web. It may feel like it's not that important, but trust me, it is :)

(PS: Sorry, but your second comment with #DEADBE i don't understand.)

Flags: needinfo?(ladislav.horvath)
You need to log in before you can comment on or make changes to this bug.