elementary / flatpak-platform

The elementary OS and AppCenter Flatpak platform
https://elementary.io
GNU General Public License v3.0
53 stars 10 forks source link

GTK settings in distributions like Feren OS is set to an invalid value #72

Closed dominichayesferen closed 3 months ago

dominichayesferen commented 2 years ago

I'm not sure if this is entirely related to #1 and #28 and the likes, but just in case it's not known it's causing actual issues in non-elementary-OS scenarios, I thought I'd make this extra issue in case. Feel free to close it if it's indeed a duplicate of any existing issues.

What Happened

Basically elementary OS's applications in the Flatpak format are horribly visually broken in certain, if not all, non-elementary OS environments. A quick DEBUG mode variable shows that the Flatpaks are set to use... nothing (I'm suspecting they're using, in my case, 'feren' and 'Inspire' (the Feren OS theme combo), but since they don't exist inside the Flatpak they're effectively nothing values in the GTK+ debugger).

This is troublesome especially as:

Camera (bug in effect): image

Camera (after changing values): image

Fondo (bug in effect, also notice that dark mode doesn't work in this buggy state): image

Fondo (after changing values, dark mode now works): image

Calendar (bug in effect): image

Calendar (after changing values): image

Dippi is the only case I know of of automatic theme setting: image

...and finally, while it isn't in AppCenter currently, I'll just demonstrate the potential unusability this bug could, theoretically, cause using Byte (forced Adwaita values, to illustrate a point): image

Expected Behavior

At the very least, the fallback should be io.elementary.stylesheet.blueberry with elementary icon set

Steps to Reproduce

  1. Add the AppCenter repository to a distribution like Feren OS (is easy enough, just follow Linux Mint's instructions)
  2. Install io.elementary.camera or any other package from AppCenter that's built around elementary OS's theme
  3. Open the newly installed application

Logs

Platform Information

The latest version of Feren OS is in use for this issue report, however I'd suspect this same issue would occur elsewhere, if not just in all KDE Plasma distributions.

alatiera commented 2 years ago

I'm suspecting they're using, in my case, 'feren' and 'Inspire' (the Feren OS theme combo), but since they don't exist inside the Flatpak they're effectively nothing values in the GTK+ debugger).

That's exactly what's happening, the portal is exposing the string of the host style which is not available inside the sandbox.

I don't think running elementary apps on non-elementary OS is a "supported" usecase as of now. In order to fix this there needs to be a guarantee that the application will be using the correct stylesheet.

Dippi for example explicitly sets the style and icon-theme to elementary. another option would be to have libgranite do it instead to avoid apps having to "opt-in" the non-broken mode, this is what will be happening in libadwaita as well. Or what https://github.com/elementary/flatpak-platform/pull/30 is doing and patch GTK's default itself.

dominichayesferen commented 2 years ago

I think the best port of call WOULD be to have LibGranite do it instead, since it's the elementary OS equivalent of LibAdwaita, technically, and there's no way I'd think in normal usage for there to be other theme choices anyway besides io.elementary.stylesheet.idk or Adwaita. Heck, I thought that was already the case... nevermind.

Obviously you'd still need to support your in-house accent variations, but I'm sure that'd be easy enough to do. I thought I'd make this issue anyway just so that this bug has its own dedicated issue to discuss on, as I would like to make AppCenter an available Flatpak repository in Feren OS some time, but would rather the bugs get ironed out first.

dominichayesferen commented 1 year ago

Possibly related: #30

tintou commented 1 year ago

This is because of https://github.com/flatpak/flatpak/issues/4873

Marukesu commented 1 year ago

This is because of flatpak/flatpak#4873

i don't think so, the issue here is with apps using the elementary runtime. they have the elementary stylesheet in the sandbox already.

i believe the best solution is go the libadwaita route and have it hardcoded as part of the granite library. #30 has some limitations (won't work for icon themes, fonts, and won't respect the dark theme application preference).

dominichayesferen commented 1 year ago

This is because of flatpak/flatpak#4873

i don't think so, the issue here is with apps using the elementary runtime. they have the elementary stylesheet in the sandbox already.

i believe the best solution is go the libadwaita route and have it hardcoded as part of the granite library. #30 has some limitations (won't work for icon themes, fonts, and won't respect the dark theme application preference).

Technically, I think that would be easy enough to implement? - there's already possible reference code in https://github.com/elementary/granite/pull/501 's removals, so I guess it ultimately depends on who gets to doing the pull request first, given I have a suspicion this could be the new goal (given LibAdwaita doing that), to finally close this issue, instead of the current inactive pull request.

dominichayesferen commented 1 year ago

Nevermind, work is in progress to effectively put the stylesheet inside Granite itself(?), presumably also fixing this issue https://github.com/elementary/granite/pull/639

dominichayesferen commented 1 year ago

I'm assuming https://github.com/elementary/granite/commit/6f035b7333ad00a972a78e6c07275a2add361565 means that once the next Granite release happens this bug can be closed as FIXED?

dominichayesferen commented 3 months ago

I suppose, the only thing left now is for Flatpaks to use the updated Granite, hence I'll put this issue out of its misery finally.