Flatpak applications are suddenly using the GTK file picker instead of Qt -- how do I change it back?

I’ve been encountering this strange issue. I’m using a setup similar to Fedora KDE spin. Before a few weeks ago, Flatpaks would use the Qt file picker with a dark theme. Now they are suddenly using the GTK file picker with a light theme. I suspect this has to do with xdg-desktop-portal-kde somehow being replaced with xdg-desktop-portal-gnome, but I can’t figure out how to change it back.

This is extremely frustrating because the GTK file picker is badly handi-capped compared to the Qt one, and everything was working fine before.

Additionally, some Flatpaks are completely stuck on light theme, such as Calibre.

That is almost definitely the issue.

What happens if you sudo dnf install xdg-desktop-portal-kde

xdg-desktop-portal-kde is already installed.

Attempting to remove xdg-desktop-portal-gnome tries to remove GTK4. Removing xdg-desktop-portal-gtk succeeds, but doesn’t fix the issue.

Is it removing gtk4 because it is an unused dependency?

Oh, it was! Not sure how I missed that.

So the solution was

dnf remove xdg-desktop-portal-gnome

Note to anyone trying to remove xdg-desktop-portal-gnome — I had to relog after doing it. It will be broken until you log back into your session.

This fixed the file picker, but for some reason the KDE Qt theme is still not applying for some flatpaks, such as Calibre.

It appears Qt theme is getting applied for Qt5 applications but not Qt6. And because the KDE file picker used by portals is Qt6, it doesn’t get a theme applied no matter what app.

I’m perplexed here. Just trying to get Breeze-Dark theming working inside Flatpak like it was working before. Unfortunately I don’t have any clue what caused this to begin with, other than an update I did a few weeks ago.

As far as I know, plasma doesn’t have full theming integration support for qt6 yet.

I’m not sure what this means. Everything worked perfectly before, including theme changes for Qt6 apps under Flatpak. Should be able to go back to the old behavior, unless something has actually been removed from upstream.

Possibly related bug report page: 458865 – After an update to qt5-base the dolphin file picker dialog used in GTK applications via GTK_USE_PORTAL=1 ignores theming

Here is a “work around”:

add XDG_CURRENT_DESKTOP=KDE to /etc/environment and reboot.

Still unable to get Qt6 themes in Calibre, but the file picker is now using the correct theme.