Bug 507330 - KIO::highlightInFileManager does not work in Flatpak apps
Summary: KIO::highlightInFileManager does not work in Flatpak apps
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.16.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-21 19:26 UTC by Nate Graham
Modified: 2025-11-21 20:04 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2025-07-21 19:26:28 UTC
This is because it calls out to org.freedesktop.FileManager1, which is blacklisted by default in Flatpak.

Instead of whitelisting it in each one of our apps (manual and error-prone) or our SDK (over-broad and controversial), we can change the DBus call from:

org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1 ShowItems

to:

org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.OpenURI.OpenDirectory

…but only if we detect we're in a sandbox.
Comment 2 David Edmundson 2025-07-21 21:18:42 UTC
>…but only if we detect we're in a sandbox.

I can't see a reason to do that. It should work with anything.
Simpler code is better code.
Comment 3 Nate Graham 2025-07-21 21:44:52 UTC
I guess it's a trade-off between code complexity vs internal implementation complexity. Always going through the portal means:
- A de facto dependency on xdg-desktop-portal in KIO
- A more complex internal path to opening the file manager, and therefore potentially lower speed and higher vulnerability to the portal functionality being broken
Comment 4 David Redondo 2025-07-22 09:02:54 UTC
OpenDirectory only supports one File and you have to have an open fd to it
Comment 5 Nate Graham 2025-11-20 16:22:15 UTC
Git commit c84861e61fcfd664f5350a662479202f6912be53 by Nate Graham.
Committed on 20/11/2025 at 16:12.
Pushed by ngraham into branch 'master'.

Flatpak: Allow-list org.freedesktop.FileManager1

Otherwise the file doesn't get highlighted.

M  +2    -1    .flatpak-manifest.json

https://invent.kde.org/graphics/koko/-/commit/c84861e61fcfd664f5350a662479202f6912be53
Comment 6 Bug Janitor Service 2025-11-20 22:22:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1945
Comment 7 Nate Graham 2025-11-21 20:04:40 UTC
Git commit c59e05f8e537dc845afe9062f290646b8080f318 by Nate Graham.
Committed on 21/11/2025 at 20:04.
Pushed by ngraham into branch 'master'.

Flatpak: Allow-list org.freedesktop.FileManager1

Otherwise the file doesn't get highlighted.

M  +2    -1    .flatpak-manifest.json

https://invent.kde.org/utilities/kate/-/commit/c59e05f8e537dc845afe9062f290646b8080f318
Comment 8 Nate Graham 2025-11-21 20:04:59 UTC
Git commit 72202ea2ec9af097aee1defb002ea1eacae3ea5f by Nate Graham.
Committed on 21/11/2025 at 20:04.
Pushed by ngraham into branch 'release/25.12'.

Flatpak: Allow-list org.freedesktop.FileManager1

Otherwise the file doesn't get highlighted.


(cherry picked from commit c59e05f8e537dc845afe9062f290646b8080f318)

Co-authored-by: Nate Graham <nate@kde.org>

M  +2    -1    .flatpak-manifest.json

https://invent.kde.org/utilities/kate/-/commit/72202ea2ec9af097aee1defb002ea1eacae3ea5f