Bug 497967

Summary: GTK file picker does not use the Adwaita:dark theme
Product: [Applications] kdenlive Reporter: icaliberdev
Component: User Interface & MiscellaneousAssignee: Jean-Baptiste Mardelle <jb>
Status: REPORTED ---    
Severity: task CC: icaliberdev
Priority: NOR    
Version First Reported In: 24.12.0   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Kdenlive using the wrong theme for the GTK file picker

Description icaliberdev 2024-12-28 05:51:08 UTC
Created attachment 176920 [details]
Kdenlive using the wrong theme for the GTK file picker

SUMMARY
The GTK file picker is the wrong theme (Adwaita instead of Adwaita:dark) in the flatpak.

For example, the GTK file picker that pops up when you create a new project (Ctrl + N) then select a custom folder is in Adwaita light theme, despite the system GTK theme set to Adwaita:dark.

STEPS TO REPRODUCE
1. Install the Kdenlive flatpak version 24.12.0
2. Set the GTK theme to Adwaita:dark using gsettings and/or GTK_THEME
3. Open Kdenlive and navigate to a situation that requires the GTK file picker (as described above)

OBSERVED RESULT
The file picker still uses the regular Adwaita light theme instead of Adwaita:dark

EXPECTED RESULT
The file picker uses the Adwaita:dark theme

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
Packaging: Flatpak
Linux Kernel: 6.12.6-arch1-1
Compositor: Sway

ADDITIONAL INFORMATION
There are a number of things that I have already tried that did not work:
* flatpak override --env=GTK_THEME=Adwaita:dark
* I have also used gsettings to set the theme to Adwaita:dark
* The Arch Wiki asks me to install org.kde.KStyle.Adwaita (https://wiki.archlinux.org/title/Flatpak#Flatpak_Qt_applications_do_not_use_Gnome_Adwaita_dark_theme). Both versions 6.6 and 6.7 of org.kde.KStyle.Adwaita are installed, but nothing changes.
* Switching the Application Style to Adwaita-dark in the Settings menu does not help either.

I have also tried to set a user installed theme (in $XDG_DATA_HOME/themes), but that doesn't seem to work with any flatpak.
Comment 1 icaliberdev 2024-12-29 08:51:16 UTC
I should also mention that other GTK flatpaks pick up on Adwaita:dark being set. Flatseal seems to pick this up, even though it has no access to the GTK_THEME variable in it's environment variables override, but it does have access to org.gnome.Software in DBUS.