Skip to content

File dialogs bypass xdg-desktop-portal on Linux (GTK3 dialog hardcoded by Wails v2) #132

Closed

Description

@wienieclaurowy

On Linux, Aether's file and folder dialogs (Select Wallpaper, Choose Wallpaper Folder, Choose Export Directory, Import) always show GTK3's built-in file chooser. They never go through xdg-desktop-portal, so the file picker the user has configured for their desktop is ignored.

Why it happens

The five dialogs in app.go use wailsrt.OpenFileDialog / wailsrt.OpenDirectoryDialog. In Wails v2.16.0 these are implemented with gtk_file_chooser_dialog_new (v2/internal/frontend/desktop/linux/window.c, line 768), which draws the dialog in-process and never talks to the portal. Setting GTK_USE_PORTAL=1 or GDK_DEBUG=portals has no effect, because those only apply to GtkFileChooserNative / GtkFileDialog.

How I confirmed it

  1. Point the portal's FileChooser at a different backend, for example xdg-desktop-portal-termfilechooser (yazi) via ~/.config/xdg-desktop-portal/hyprland-portals.conf:
    [preferred]
    default=hyprland;gtk
    org.freedesktop.impl.portal.FileChooser=termfilechooser
    
  2. Restart xdg-desktop-portal. Browsers, Electron apps and GTK4 apps now show the configured picker.
  3. Start Aether (4.30.0, Omarchy package) with GTK_USE_PORTAL=1 GDK_DEBUG=portals, and open Editor → pick a wallpaper.

Expected: the configured portal picker opens.
Actual: GTK3's GtkFileChooserDialog opens. dbus-monitor --session "interface='org.freedesktop.portal.FileChooser'" shows no OpenFile call at all while the dialog is open.

Possible fix

Call org.freedesktop.portal.FileChooser.OpenFile over D-Bus (godbus is already in the module graph through Wails) and fall back to the Wails dialog when no portal answers. With Omarchy's default portal config (hyprland;gtk), users would get the GTK portal's file chooser, which looks very close to what they see today.

Wails v3 uses GtkFileDialog and so goes through the portal, but migrating is a much larger change. I have a small PR for the portal approach ready and will link it here.

Activity

  1. wienieclaurowy commented on Sep 28, 2026

    @wienieclaurowy
    ContributorAuthor

    PR with the portal approach: #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions