Link in flatpak apps won't open on click since anymore last update

Have you attempted to remove these, and install updated versions (if they are available)?

I have last versions installed, these are not the only applications affected by the problem, I took these two ones as example.

I don’t use flatpak; I prefer appimage, if I ever need to, so I’m likely no help in this instance.

What happens if you restart the portals?:

systemctl --user restart xdg-desktop-portal
systemctl --user restart xdg-desktop-portal-gtk

Are they running ?

systemctl --user status xdg-desktop-portal xdg-desktop-portal-gtk xdg-document-portal

OK. This was a dead-end:

Is dumping Flatpak entirely, an option?

This is likely caused by the recent updates to xdg-desktop-portal and xdg-desktop-portal-gtk. Downgrading those packages to the previous versions (xdg-desktop-portal-1.16.0-3-x86_64.pkg.tar.zst and xdg-desktop-portal-gtk-1.14.1-1-x86_64.pkg.tar.zst) should restore the ability to click links.

Lots of discussion in [Xdg-desktop-portal upgrade breaks GTK apps] but I haven’t had a chance to try to sort it all out.

OK looks that xdg-desktop-portal-gtk.service is inactive

$ systemctl --user status xdg-desktop-portal xdg-desktop-portal-gtk xdg-document-portal
● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Tue 2023-10-17 18:35:39 CEST; 3h 14min ago
   Main PID: 2211 (xdg-desktop-por)
      Tasks: 6 (limit: 27388)
     Memory: 7.8M
        CPU: 183ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal.service
             └─2211 /usr/lib/xdg-desktop-portal

oct. 17 18:35:39 michael-20ygcto1ww systemd[1950]: Starting Portal service...
oct. 17 18:35:39 michael-20ygcto1ww xdg-desktop-por[2211]: No skeleton to export
oct. 17 18:35:39 michael-20ygcto1ww systemd[1950]: Started Portal service.

○ xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-gtk.service; static)
     Active: inactive (dead)

● xdg-document-portal.service - flatpak document portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-document-portal.service; static)
     Active: active (running) since Tue 2023-10-17 18:35:39 CEST; 3h 14min ago
   Main PID: 2223 (xdg-document-po)
      Tasks: 9 (limit: 27388)
     Memory: 5.6M
        CPU: 111ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-document-portal.service
             ├─2223 /usr/lib/xdg-document-portal
             └─2266 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc

oct. 17 18:35:39 michael-20ygcto1ww systemd[1950]: Starting flatpak document portal service...
oct. 17 18:35:39 michael-20ygcto1ww systemd[1950]: Started flatpak document portal service.

In that case give it a restart

systemctl --user restart xdg-desktop-portal-gtk.service

If it is continually failing to start after boot then maybe we can investigate that as the issue.

Might not be way due to Wayland in my case (anyway the post you reference also reports that issue happen with X11)

In my case

$ echo $XDG_SESSION_TYPE
x11

ok thank you. The service is restarting with the command, but

  • clicking on links from flatpak apps still doesn’t work, even if I quit the the flatpak application and restart it
  • service xdg-desktop-portal-gtk.service is killed as soon as I quit my X11 session, then when I come back to a new X11 session I have to manually restart the service with the command you typed here

Should this not be:

systemctl --user restart xdg-desktop-portal.service

As I understand it, xdg-desktop-portal-gtk is a backend, that is loaded/used by xdg-desktop-portal as needed; unless I’m mistaken; and that’s possible, as I haven’t needed to explore this area until these recent issues arose.

XDG Desktop Portal

It should be started automatically.
But it should also be running.

Example here:

$ systemctl --user status plasma-xdg-desktop-portal-kde.service
● plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE
     Loaded: loaded (/usr/lib/systemd/user/plasma-xdg-desktop-portal-kde.service; static)
     Active: active (running) since 10h ago
   Main PID: 1240 (xdg-desktop-por)
      Tasks: 7 (limit: 16537)
     Memory: 20.2M
        CPU: 973ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/plasma-xdg-desktop-portal-kde.service
             └─1240 /usr/lib/xdg-desktop-portal-kde

 systemd[1067]: Starting Xdg Desktop Portal For KDE...
 systemd[1067]: Started Xdg Desktop Portal For KDE.

(so its been running since boot, as it should be … also obviously KDE here instead)

both packages were upgraded in september, and since upgrade everything worked fine until last OS update, so I doubt it’s connected with the packages versions.

[2023-10-09T19:06:32+0200] [ALPM] upgraded xdg-desktop-portal-gtk (1.14.1-1 -> 1.14.1-3)
[2023-10-09T19:06:32+0200] [ALPM] upgraded xdg-desktop-portal (1.16.0-3 -> 1.18.0-2)

I tried to downgrade xdg-destkop-portal-gtk tough but issue still persists

I’ve learned that flatpak devs seem to have been wrestling with this issue for over five years, without any definitive outcome (See link at my post #9).

The issue was closed on September 11, 2003, with the final resolution equating to not much more than a shrug of the shoulders. :man_shrugging: :person_shrugging: :woman_shrugging:

I ran into this issue too on a new Manjaro Cinnamon install. Spend 4 hours, tried all the tricks and checked all the checks… and finally found a solution thanks to this Github comment.

I ran /usr/lib/xdg-desktop-portal --verbose --replace

and for good measure right after that

I ran /usr/lib/xdg-desktop-portal-gtk --verbose --replace

and that fixed the problem for me. So maybe only the first command is enough to fix the issue :wink:

xfce here too, same issue

Failed to call portal: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Nenhuma interface ?org.freedesktop.portal.OpenURI? no objeto no caminho /org/freedesktop/portal/desktop

@vi.o.vini
Did you try the commands in the @muvvenby post (scroll up)?

I had this issue too: clicking on links in flatpak apps wouldn’t open in my default browser, also the file manager wouldn’t open (like in Warehouse in case of “Open User Data Folder”)

Troubleshooting:

flatpak run --log-session-bus your.installed.flatpak.app.of.choice

Clicking on link or open mime inode/directory showed:

C13: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.OpenURI.OpenURI at /org/freedesktop/portal/desktop
B109: <- :1.39 return error org.freedesktop.DBus.Error.UnknownMethod from C13

Checked mime types were set:

gio mime inode/directory
gio mime x-scheme-handler/https
(those were set correctly in my case)

Gave them a go:

gio open https://forum.manjaro.org
(opened the URL as expected in my default browser)

The fix:

I made sure XDG_CURRENT_DESKTOP environment variable was set

echo $XDG_CURRENT_DESKTOP
XFCE
systemctl --user import-environment XDG_CURRENT_DESKTOP
systemctl --user show-environment

Made sure xdg-desktop-portal-gtk is installed

Added a new portals conf for XFCE

~/.config/xdg-desktop-portal/xfce-portals.conf

[preferred]
default=gtk;

Restarted services:

systemctl --user restart xdg-desktop-portal.service xdg-desktop-portal-gtk.service

Success, links finally opened in the default browser and file manager could be started by flatpak apps

Hope this helps.

1 Like

Similar methodology outlined here (i have no idea if you really want xapp to be the default?)

Thanks for the feedback. I’m really not an expert and hoped sharing my fix would result in either validation or constructive criticism. Xapp sounded like a good default for XFCE, its description says “A backend implementation for xdg-desktop-portal using GTK and various pieces of Cinnamon/MATE/Xfce4 infrastructure”. My understanding is, GTK is the fallback anyway? Should be ok, no?