Bug 2455362 - xdg-desktop-portal causes nautilus to open wrong initial directory
Summary: xdg-desktop-portal causes nautilus to open wrong initial directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xdg-desktop-portal
Version: 44
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: David King
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException
Depends On:
Blocks: F44FinalFreezeException
TreeView+ depends on / blocked
 
Reported: 2026-04-06 13:46 UTC by Michael Katzmann
Modified: 2026-04-13 21:06 UTC (History)
7 users (show)

Fixed In Version: xdg-desktop-portal-1.21.1-1.fc44
Clone Of:
Environment:
Last Closed: 2026-04-13 21:06:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
example program to show bug (1.44 KB, text/x-csrc)
2026-04-06 13:50 UTC, Michael Katzmann
no flags Details

Description Michael Katzmann 2026-04-06 13:46:00 UTC
When the nautilus file dialog is invoked through xdg-desktop-portal-gnome, the intended initial directory is not shown correctly, instead the parent of the directory is displayed.

    gchar *sDirectory = "/usr/share/icons";
    GtkFileDialog *fileDialogRecall = gtk_file_dialog_new ();
    GFile *fPath =  g_file_new_for_path( sDirectory );
    gtk_file_dialog_set_initial_folder( fileDialogRecall, fPath );

    gtk_file_dialog_open ( fileDialogRecall, NULL, NULL, CB_open, NULL);

should display the nautilus file dialog for the directory /usr/share/icons. It actually shows /usr/share.

This code worked correctly in gnome 49 but does not in gnome 50.

It works correctly if GDK_DEBUG=no-portals is set.

See the attached example program...

I filed a bug upstream, so this is more of a place-holder (as I can't verify that its fixed until the RPM is updated).

https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/208


Reproducible: Always

Steps to Reproduce:
1. Use "save page as" in Firefox (for example) several times
2. Notice that each time it opens the parent directory of where the last save occurred
3. (or run the attached example)
Actual Results:
Should open the file window on the specified directory

Expected Results:
The parent directory is opened instead

Comment 1 Michael Katzmann 2026-04-06 13:50:12 UTC
Created attachment 2136039 [details]
example program to show bug

Although the upstream bug says its related to a trailing /, adding one does not solve the issue.

Comment 2 Calvin Walton 2026-04-08 12:47:55 UTC
This was a bug in xdg-desktop-portal and has been fixed upstream: https://github.com/flatpak/xdg-desktop-portal/pull/1945 but there is not yet a release with the fix.

Comment 3 Michael Katzmann 2026-04-09 20:50:01 UTC
Yep, I tried 1.21.1 pre-release of xdg-desktop-portal (https://github.com/flatpak/xdg-desktop-portal/releases/tag/1.21.1) and it fixes the problem.
Presumably this will rollout to Fedora 44 soon.

Comment 4 Kamil Páral 2026-04-13 13:56:27 UTC
Here's the update, it fixes the problem:
https://bodhi.fedoraproject.org/updates/FEDORA-2026-7d3abc675f

Comment 5 Kamil Páral 2026-04-13 14:26:57 UTC
Proposing for a freeze exception. This affects all apps using this portal (e.g. gnome-text-editor, Firefox, etc) in both open and save operations. It is very annoying if you want to open or save 5+ files from the same directory, and it always puts you into the parent directory, so you need to select the right directory over and over again.

While this can be shipped as a 0-day update, this also affects LiveCD usage, and initial first impressions after install, and it makes bad first impressions.

Comment 6 Lukas Ruzicka 2026-04-13 18:33:44 UTC
AGREED AcceptedFinalFreezeException

Discussed at the 2026-04-13 (blocker / freeze exception) review meeting:

This is certainly an annoying bug for portal-using apps where you use the file chooser, and you can encounter it on live media, so a Freeze Exception makes sense. We also note that the update fixes a CVE and likely some crashes too.

https://meetbot-raw.fedoraproject.org//blocker-review_matrix_fedoraproject-org/2026-04-13/f44-blocker-review.2026-04-13-16.00.log.txt

Comment 7 Fedora Update System 2026-04-13 20:22:45 UTC
FEDORA-2026-7d3abc675f (xdg-desktop-portal-1.21.1-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-7d3abc675f

Comment 8 Fedora Update System 2026-04-13 21:06:36 UTC
FEDORA-2026-7d3abc675f (xdg-desktop-portal-1.21.1-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.