Bug 467460 - GTK_USE_PORTAL=1 fails to propagate the org.FreeDesktop.portal.FileChooser setting "current_folder"
Summary: GTK_USE_PORTAL=1 fails to propagate the org.FreeDesktop.portal.FileChooser se...
Status: RESOLVED INTENTIONAL
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-16 20:21 UTC by kderemie
Modified: 2023-03-24 07:54 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kderemie 2023-03-16 20:21:31 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Set GTK_USE_PORTAL=1
2. Trigger the open file dialog for an application like Sublime Text which explicitly sets the folder the file picker should open to
3. The requested folder is ignored and the last opened directory is opened by default instead

OBSERVED RESULT
File picker always opens to the last opened folder

EXPECTED RESULT
File picker should open to the directory requested by the opening application

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kubuntu 22.10
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION

The GTK file chooser is awful. I'd be sooo happy if this would work as expected so we could ditch GTK entirely.
Comment 1 kderemie 2023-03-21 22:10:15 UTC
Is there anything I can do to help move this issue forward?
Comment 2 David Redondo 2023-03-23 09:18:53 UTC
As far as I can see the openFile method does not have a current_folder option, only SaveFile(s)
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.FileChooser
Comment 3 kderemie 2023-03-23 19:56:53 UTC
(In reply to David Redondo from comment #2)
> As far as I can see the openFile method does not have a current_folder
> option, only SaveFile(s)
> https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.
> FileChooser

Thanks for diving into this David! I found a relevant issue here: https://github.com/flatpak/xdg-desktop-portal/pull/874

If that's resolved in xdg-desktop-portal, is there additional work required to get KDE to be compatible with that change?
Comment 4 David Redondo 2023-03-24 07:54:46 UTC
Once it is acepted we would have to implement support of the option but it should be straight forward