Closed Bug 1961468 Opened 1 month ago Closed 20 days ago

Firefox Snap - Color management not working under Wayland

Categories

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

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: ladislav.horvath, Unassigned, NeedInfo)

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: 20 days 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.

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