Particularly with Google Chrome (but the problem might not be exclusive to that program), clicking things that should open the file chooser dialog box seem to do nothing. Examples include clicking the attach file button ( ) in gMail or trying to attach an image when composing an issue report in GitLab. This problem also happens when right-clicking on an image in a web page and selecting āSave image asā¦ā.
Cause
According to Joe P., āfor xdg-desktop-portal-gtk (amongst others) to show the file picker, systemd needs to have a (default) DISPLAY env variable in its own systemd environmentā (bugzilla.redhat.com ā BZ#2241173 ā Comment 5).
Add the below line to your ~/.config/sway/config. You should probably put the following line near the end of your configuration, but before you start launching any other programs with exec ... lines.
Thanks for the write-up. Looking at the bug reports, people complained last year, but no-one complained this year. Is the bug still present, even on currently supported Fedora versions (Iām mostly interested about Fedora 40)?
Also, it seems that this doesnāt affect Fedora Sway (standard/atomic) spin users by default, only if you mix and match environments and xdg-desktop-portal-gtk gets installed? Can you verify and include it in your description?
Lastly, in order to have this bug fixed, it needs to be reported upstream (either xdg-desktop-portal-gtk or sway, not sure what is better), but I see no link to such a report. Can you create this report and update Bugzilla and this topic with that upstream ticket? Thanks.
Ah, so that is what I was missing. IIRC, I installed Sway using something along the lines of dnf group install "Sway Desktop". If my installation method is unusual enough to disqualify this as a common issue, I understand. Thanks!
sway-systemd is a weak dependency of the sway-config-fedora package, which is installed when you run dnf group install "Sway Desktop". If you have weak dependencies installed, you should have it. Also, if you have a user configuration file in your home directory, you need to put include /etc/sway/config.d/* in it.
That explains it. I have install_weak_deps=0 in /etc/dnf/dnf.conf. I think there might be a case to be made that sway-systemd should be a hard dependency. But Iāll leave that to you and withdraw this ācommon issueā report since Iāve clearly deviated from the norm more than I realized. Thanks for the detailed explanation.
Edit: I was also missing include /etc/sway/config.d/* in my ~/.config/sway/config. But that is my mistake as well. The config Iām using was carried over from an earlier i3 installation and modified. Thanks again for pointing that out.
Thanks a lot, @ersen! Iām glad this got sorted out. I updated the bugzilla with some hints, if anyone wants to make the experience better for ānon-weak-deppersā