For the past couple of months, I haven’t been able to open the file-picker dialog in Chromium-based browsers like Chrome and Brave.
I had first assumed that it was probably because I was missing some system package a la xdg-desktop-portal
, but alas no, I already had both the gtk
and wlr
backends installed.
Plus, it seemed to work perfectly fine in other application, such as Firefox, so I eventually concluded that it was probably just a quirk of Chromium on Wayland.
Recently, however, I came across a GitHub issue describing the same problem and an albeit hacky solution.
The Fix
- Make sure that you have the
xdg-desktop-portal-gtk
package (or equivalent xdg portal backend) package installed. cd
to the root directory/
and search for a file calledgtk.portal
. I used the commandfd gtk.portal
and found it at/usr/share/xdg-desktop-portal/portals/gtk.portal
.- Open the file in your text-editor of choice, and add
sway
to theUseIn
key. For example, I changedUseIn=gnome
toUseIn=gnome;sway
.
Now, logging out for good measure, you should be able to open file dialogs in Chrome!