Skip to content

fix(opener): open files and URLs through freedesktop D-Bus services - #3725

Open
Alfagun74 wants to merge 1 commit into
tauri-apps:v2from
Alfagun74:fix/opener-freedesktop-open
Open

Alfagun74 wants to merge 1 commit into
tauri-apps:v2from
Alfagun74:fix/opener-freedesktop-open

Conversation

@Alfagun74

@Alfagun74 Alfagun74 commented Oct 21, 2026 •

Copy link
Copy Markdown

On Linux, open_path and open_url now talk to the desktop over D-Bus instead of spawning xdg-open/gio/kde-open* found through PATH:

  • directories use org.freedesktop.FileManager1.ShowFolders
  • files use org.freedesktop.portal.OpenURI.OpenFile
  • URLs use org.freedesktop.portal.OpenURI.OpenURI

Any D-Bus error falls back to the existing open call, so headless setups keep working. The main benefit is for Flatpak and Snap builds, where spawning a host handler through PATH is not reliable. This also covers desktops without a working xdg-open or gio.

The D-Bus calls run on a dedicated thread because zbus::blocking starts its own runtime, matching what reveal_item_in_dir already does.

Tested with cargo test -p tauri-plugin-opener, cargo clippy -p tauri-plugin-opener --all-targets and cargo fmt --check. The classification test covers files, folders, URLs and unknown inputs.

Note: the original AppImage report (#3724) turned out to be caused by Tauri CLI 2.11.4 bundling xdg-open; CLI 2.12.0+ no longer does. This PR is therefore an enhancement for sandboxed builds and broken launcher setups, not a fix for that specific AppImage case.

On Linux, `open_path` and `open_url` spawned launchers resolved through
`PATH`. AppImages prepend their bundled `usr/bin`, so a bundled `xdg-open`
can shadow the host binary and swallow the request.

Route directories through `org.freedesktop.FileManager1.ShowFolders` and
files and URLs through `org.freedesktop.portal.OpenURI`, falling back to
the existing `open` path when the service is unavailable. This reaches
the host desktop in AppImage, Flatpak and Snap builds.

Refs: tauri-apps#3724
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