ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.25k stars 175 forks source link

File picker requires picking files even when a directory is needed #9377

Closed tatokis closed 1 year ago

tatokis commented 1 year ago

Your system information

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
tatokis commented 1 year ago

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

lostgoat commented 1 year ago

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.

Benedolt commented 1 year ago

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.

z0rti commented 1 year ago

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?

kisak-valve commented 1 year ago

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.

z0rti commented 1 year ago

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/

Benedolt commented 1 year ago

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

segaretroboy commented 1 year ago

Also having this issue Runtime info here https://gist.github.com/segaretroboy/ff1f919831542237d9e29d1c6af35ff7 20230704_21h25m29s_grim

kisak-valve commented 1 year ago

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

The follow up issue is being tracked at #9797.