protonscr

File picker requires picking files even when a directory is needed

steamclosed
ValveSoftware/steam-for-linux#9377 · opened 2023-04-28 by tatokis · updated 2023-09-16 · 9 comments · github
Ttatokis 2023-04-28 github

Your system information

  • Steam client version (build number or date): 1682634349
  • Distribution (e.g. Ubuntu): Ubuntu 20.04
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

Attempting to "Create a backup of the installed files to restore this game in the future" fails due to the file picker demanding a file is picked instead of a directory. The GTK 3 file picker shows up for me. It seems to not be instructed to allow the user to pick a directory, as even when you do end up navigating into an empty directory, the open button gets greyed out.

This appears to happen on anything that requests a path to a directory. For example, I am also unable to change the screenshot folder.

Steps for reproducing this issue:

  1. Right click on game
  2. Click Properties
  3. Select Installed Files
  4. Click Backup game files
  5. Click Browse...
  6. Attempt to pick a directory
Ttatokis 2023-04-28 github

After digging further into this, it looks like steam is using the XDG Desktop portal.

method call time=1682678066.907058 sender=:1.389 -> destination=:1.402 serial=93 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.FileChooser; member=OpenFile
   string ""
   string "Create or select new Steam library folder"
   array [
      dict entry(
         string "handle_token"
         variant             string "steamfileopenportal1469229840"
      )
      dict entry(
         string "directory"
         variant             boolean true
      )
      dict entry(
         string "current_folder"
         variant             array of bytes "" + \0
      )
      dict entry(
         string "multiple"
         variant             boolean false
      )
      dict entry(
         string "modal"
         variant             boolean false
      )
      dict entry(
         string "filters"
         variant             array [
            ]
      )
   ]

The directory bool was added in version 3 of the interface (since 1.7.1). My system has version 2, and thus ignores it. I'm not sure what can be done about this, but it's an unfortunate omission of a critical feature.

I am currently working around this by manually building xdg-desktop-portal and xdg-desktop-portal-gtk with these patches backported:
https://github.com/flatpak/xdg-desktop-portal/commit/c616b491fe0ac67f78a14bcaf0d3a150bfadfd82
https://github.com/flatpak/xdg-desktop-portal-gtk/commit/920afdde7afc023e77ecfeb4e174cb42f22cbfe3

Llostgoat 2023-04-28 github

Thanks for the info, sadly it looks like we'll need to fall back to a different file picker if we detect version 2 and a directory is requested.

BBenedolt 2023-06-28 github

I have exactly the same issue trying to a Steam library folder. I have an existing library folder on another disk, steam "forgot" about it and I can't add it back, because the filepicker doesn't accept directories.

Running the steam client beta (deb) on Ubuntu 20.04.

Zz0rti 2023-06-28 github

I have exactly the same issue
There is a workaround in #9666 that worked for me (manually adding via console)

Maybe there could be a message like "old portal detected please upgrade" or
if portal version < 3 detected then do not use it, but present a console or input field one could paste the path in?

Kkisak-valve maintainer 2023-06-29 github

Hello, per "Fix incorrectly spawning a file chooser instead of a directory chooser on systems with xdg-desktop-portal FileChooser version 2." in the 2023-06-29 Steam client beta update, please opt into Steam's beta and retest.

Zz0rti 2023-06-29 github

I would, but i just noticed that none of the dropdown boxes work, can't select 'beta' or 'language' or anything, i see the options but nothing happens when i click e.g. 'steam beta update'
(ubuntu 20.04, Steam-Version: 1687386907)

edit:
i found #9273 and was able to select beta with shift/ctrl now
when i click '+' now i get a dir picker, but i only see the content of ~/.steam/steam/
can't go anywhere else like /mnt/externalHDD/

BBenedolt 2023-07-01 github

Can confirm @z0rti's finding: With the latest client beta the old school file picker shows up, but I can only navigate the contents of ~/.steam/steam.

Screenshot from 2023-07-01 12-04-12

Ssegaretroboy 2023-07-05 github
Kkisak-valve maintainer 2023-09-16 github

Closing as fixed in the 2023-09-11 Steam client update.

The follow up issue is being tracked at #9797.

Nothing extracted yet.