Bug 461663

Summary: Cannot start Flatpak application in X11 session
Product: [Frameworks and Libraries] flatpak-platform-plugin Reporter: fw.smit01
Component: generalAssignee: Jan Grulich <jgrulich>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://github.com/fish-shell/fish-shell/issues/7485
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description fw.smit01 2022-11-10 12:17:12 UTC
SUMMARY
All icons of flatpak applications in my taskbar are blank and clicking them doesn't work either (I don't want to try that, because I believe it crashes plasma). When searching the application in Krunner or the application launcher, nothing shows up. I am able to launch the application with a flatpak run command line and it the plasma wayland session everything works as expected.

STEPS TO REPRODUCE
1. Start an X11 session
2. Enable flatpak in discover
3. Download a flatpak application 

OBSERVED RESULT
You can start the app from discover or the command line, but not from any other GUI tool in KDE. 

EXPECTED RESULT
The application shows up in the application launcher, krunner and you are able to pin it to the task bar, just like you are able to do in the wayland session.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 6.0.5-200.fc36.x86_64 (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz
Memory: 15,4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Manufacturer: HP
Product Name: HP ZBook Studio G5
Comment 1 Nate Graham 2022-11-10 17:20:30 UTC
How about from Kickoff, Kicker, or KRunner? Can you launch the Flatpak apps from those?

How did yo get the Flatpak apps in question into your Task Manager?
Comment 2 fw.smit01 2022-11-11 10:43:13 UTC
I've figured out I'm affected by https://github.com/fish-shell/fish-shell/issues/7485. Fish doesn't ready /etc/profile.d, so it's not executing /etc/profile.d/flatpak.sh. This means XDG_DATA_DIRS will not contain the right directories. It should be fixed by https://github.com/fish-shell/fish-shell/issues/7485#issuecomment-728984689.

What's interesting about this one is that the bug only happens in the X11 session and not the Wayland session. Any idea what's different there? There has already been a lot of discussion in:

https://github.com/sddm/sddm/pull/1047
https://github.com/sddm/sddm/pull/1260 (revert 1047)
https://github.com/sddm/sddm/pull/1331 (does essentially the same as 1047)

I'll have to read the complete history later, but I haven't found why it's not working for me yet.

I have /bin/sh set to /bin/bash, not fish. Only my login shell is fish (chsh -s /bin/fish).

For completeness:
(In reply to Nate Graham from comment #1)
> How about from Kickoff, Kicker, or KRunner? Can you launch the Flatpak apps
> from those?

No, none

> How did yo get the Flatpak apps in question into your Task Manager?

Via the wayland session.
Comment 3 Nate Graham 2022-11-11 20:15:53 UTC
Ah yes, the fish shell issue.

> Only my login shell is fish
In general this will only cause you pain and bugs. I'd recommend not actually changing the entire login shell to fish, and just using it in your interactive terminals.
Comment 4 fw.smit01 2022-11-14 14:11:36 UTC
(In reply to Nate Graham from comment #3)
> Ah yes, the fish shell issue.
> 
> > Only my login shell is fish
> In general this will only cause you pain and bugs. I'd recommend not
> actually changing the entire login shell to fish, and just using it in your
> interactive terminals.

Thanks, I think I didn't realize this while installing fish. Just weird that I discovered it so much later when switching from the wayland session to the X11 session.