Skip to content

Feature: Native file pickers on Linux via the desktop portal - #77

Merged
MemerGamer merged 3 commits into
mainfrom
linux/pickers
Oct 5, 2026
Merged

MemerGamer merged 3 commits into
mainfrom
linux/pickers

Conversation

@MemerGamer

Copy link
Copy Markdown
Owner

Summary

  • New IFileChooserService (Platform.Abstractions) with PortalFileChooserService (Platform.Linux) over org.freedesktop.portal.FileChooser: OpenFile (multiple/directory), SaveFile (current_name, current_folder, filters), Request/Response handshake with handle_token and Sender= match.
  • DesktopCommonDialogService now uses it: filter pairs map to portal filters, file:// URIs are decoded safely (empty/localhost authority only, NUL rejected), cancel returns the existing "cancelled" result, and no portal falls back to cancel with one logged warning.
  • Parent window passed as x11:<hex id> when known, else empty (WindowHandle is currently always 0 on Linux).
  • Unblocks settings import/export, background image, general/library/decompress/hash/properties/dev-tools pickers.

Notes

  • The shared dialog contract is synchronous, so the UI thread blocks while the chooser is open.
  • Open dialogs ignore defaultFolder (the portal has no such option); save uses it as current_folder.

Testing

7 new tests against a fake portal on a private dbus-daemon (single, multiple, directory, save, cancel, no portal, no bus). Full Files.Platform.Tests pass (871 passed, 7 skipped for missing Xvfb); Files.App net10.0-desktop builds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY

MemerGamer and others added 3 commits October 6, 2026 00:01
Implement DesktopCommonDialogService on org.freedesktop.portal.FileChooser
(OpenFile single/multiple/directory, SaveFile with name, folder and filters).
Tested against a fake portal on a private bus.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MemerGamer
MemerGamer merged commit 192a35f into main Oct 5, 2026
2 checks passed
@MemerGamer
MemerGamer deleted the linux/pickers branch October 5, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant