Open Dutt-A opened 4 months ago
You can get some logs with /usr/libexec/xdg-desktop-portal-gtk --replace --verbose
, same for the main portal.
Very interesting...
So using this method, I first typed your command into console. Then I went onto DuckDuckGo and searched up some images of fat dachsunds on flatpak ungoogled-chromium, and the GTK file chooser worked! I was able to download a fat dachsund with the GTK file chooser.
But as soon as I tried to download another fat dachsund without /usr/libexec/xdg-desktop-portal-gtk --replace --verbose
running, I could not download the fat dachsund because the GTK file chooser didn't open. Other than that, the file chooser seems to spit out some warnings,
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:56:13.661: Unhandled parent window type
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:56:13.661: Failed to associate portal window with parent window
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:56:18.889: Backend call failed: Cannot invoke method; proxy is for the well-known name org.freedesktop.ScreenSaver without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:56:49.217: Backend call failed: Cannot invoke method; proxy is for the well-known name org.freedesktop.ScreenSaver without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:57:19.536: Backend call failed: Cannot invoke method; proxy is for the well-known name org.freedesktop.ScreenSaver without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:57:49.845: Backend call failed: Cannot invoke method; proxy is for the well-known name org.freedesktop.ScreenSaver without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:58:09.533: Backend call failed: Cannot invoke method; proxy is for the well-known name org.freedesktop.ScreenSaver without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
(xdg-desktop-portal-gtk:75931): xdg-desktop-portal-gtk-WARNING **: 22:58:39.856: Backend call failed: Cannot invoke method; proxy is for the well-known name org.freedesktop.ScreenSaver without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
But that itself was enough to get to the crux of the bug! Something probably isn't running that should be in the background!
It looks like xdg-desktop-portal-gtk.service
is enabled, but it keeps failing upon startup, thereby not running when it is called by applications later on
$ systemctl --user status xdg-desktop-portal-gtk | cat
× xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-gtk.service; static)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: failed (Result: exit-code) since Mon 2024-07-22 08:09:19 EDT; 13min ago
Process: 1439 ExecStart=/usr/libexec/xdg-desktop-portal-gtk (code=exited, status=1/FAILURE)
Main PID: 1439 (code=exited, status=1/FAILURE)
CPU: 15ms
Jul 22 08:09:19 fedora systemd[1280]: Failed to start xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
Jul 22 08:09:19 fedora systemd[1280]: xdg-desktop-portal-gtk.service: Start request repeated too quickly.
Jul 22 08:09:19 fedora systemd[1280]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Jul 22 08:09:19 fedora systemd[1280]: Failed to start xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
Jul 22 08:09:19 fedora systemd[1280]: xdg-desktop-portal-gtk.service: Start request repeated too quickly.
Jul 22 08:09:19 fedora systemd[1280]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Jul 22 08:09:19 fedora systemd[1280]: Failed to start xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
Jul 22 08:09:19 fedora systemd[1280]: xdg-desktop-portal-gtk.service: Start request repeated too quickly.
Jul 22 08:09:19 fedora systemd[1280]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Jul 22 08:09:19 fedora systemd[1280]: Failed to start xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
A possibility is xdg-desktop-portal-gtk
it is executed in a different environment than your shell, so could behave different. You may need to import some env vars.
I have another idea for what is going on. After login, the message in systemctl looks like this:
systemctl --user status xdg-desktop-portal-gtk | cat
× xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-gtk.service; static)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: failed (Result: exit-code) since Mon 2024-07-22 15:21:05 EDT; 9min ago
Process: 1816 ExecStart=/usr/libexec/xdg-desktop-portal-gtk (code=exited, status=1/FAILURE)
Main PID: 1816 (code=exited, status=1/FAILURE)
CPU: 15ms
Jul 22 15:21:05 fedora systemd[1275]: Starting xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)...
Jul 22 15:21:05 fedora xdg-desktop-por[1816]: cannot open display:
Jul 22 15:21:05 fedora systemd[1275]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=1/FAILURE
Jul 22 15:21:05 fedora systemd[1275]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Jul 22 15:21:05 fedora systemd[1275]: Failed to start xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
I found that another user here was getting the same error message but managed to solve it by installing lightdm (a login manager).
Using a login manager like lightdm will ensure that both the display server and xdg-desktop-portal-gtk are started at the same time. The issue is that without a login manager, what is going on is that xdg-desktop-portal-gtk is trying to call display without sway being started first, which creates the issue.
The bandaid solution is then to plop
exec /usr/libexec/xdg-desktop-portal-gtk
into my sway config file so the portal is started when sway is started (This is what I'm doing for now).
But ideally, either xdg-desktop-portal-gtk
should always be started after the display
server is started or xdg-desktop-portal-gtk
should never call screen until the display
server is started.
Hello,
I'm on a mostly fresh install of Fedora Sway 40, and whenever I hit a button that should result in the file chooser opening up (like I try to Download something in Ungoogled Chromium or set my library in Steam), nothing happens. I've gotten stuck trying to look at fixes and debug it myself, so I was wondering if I could get some help.
system information
sway information
xdg portal package information
The last thing I tried to do to fix this was to reinstall Fedora Sway spin while keeping my home directory, but nothing got fixed. On my last install I was trying to get my
gtk
andqt6
themes to work together withkvantum
, and it may be possible along the way that I deleted something important in the~/home/username
directory. (I recall deleting~/.local/gtk-2.0
and~/.local/gtk-3.0
.I also have the following files in
/usr/share/xdg-desktop-portal
:/usr/share/xdg-desktop-portal/sway-portals
/usr/share/xdg-desktop-portal/wlroots-portals
/usr/share/xdg-desktop-portal/portals/gnome-keyring.portal
/usr/share/xdg-desktop-portal/portals/gtk.portal
/usr/share/xdg-desktop-portal/portals/wlr.portal
Any debugging tips or hints for where I should look next would be much appreciated. Thanks.
(Note: I posted this in originally in
https://github.com/swaywm/sway/issues/8260
, but I then noticed that 1 or 2 xdg-related issues got redirected to here, naturally.)Another note is that the accessing the system print dialog from Flatpak Ungoogled Chromium actually does work, though I have no printers configured.