diff mbox series

[bug#49972] gnu: xdg-desktop-portal-gtk: Update to 1.8.0.

Message ID 20210810045134.27435-1-whatson@gmail.com
State Accepted
Headers show
Series [bug#49972] gnu: xdg-desktop-portal-gtk: Update to 1.8.0. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Andrew Whatson Aug. 10, 2021, 4:51 a.m. UTC
* gnu/packages/freedesktop.scm (xdg-desktop-portal-gtk): Update to
1.8.0.
---
 gnu/packages/freedesktop.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Kehayias Aug. 10, 2021, 4:34 p.m. UTC | #1
Hi Andrew,

Thanks for the package update. There was actually just a discussion on IRC about using xdg-desktop-portal (and -gtk). It came up that it would be helpful to add to the description a note about this needing to be used as a dbus-service, with perhaps a short code snippet for the user. A few other packages do this, but I think it would be helpful to make this more widespread.

As it is, the description of xdg-desktop-portal does mention dbus but I think could be clearer. For this package, could be clearer that this is a backend to be used with xdg-desktop-portal (doesn't make sense on its own correct?). So, you would want to add this to a dbus service with xdg-desktop-portal.

Sorry if this is out of scope on this patch thread, but does this package work for you? When I try using this with xdg-desktop-portal with dbus, there are messages about not finding e.g. the OpenURI handler when links are clicked in Flatpak apps. Is there more configuration or package changes needed on Guix to make this work?

Thanks,
John
Andrew Whatson Aug. 12, 2021, 10:30 a.m. UTC | #2
Hi John,

This package works for me as-is, just installing flatpak,
xdg-desktop-portal, xdg-desktop-portal-gtk, and the patched p11-kit
from #49957.  I think flatpak launches the dbus services on-demand, so
no additional setup is needed.  The errors about the missing OpenURI
handler are fixed by this update; seeing that a version bump fixed the
problem, I haven't investigated further.

With these patches I'm successfully running Teams and Discord via
flatpak with no problems.

Cheers,
Andrew
John Kehayias Aug. 12, 2021, 7:18 p.m. UTC | #3
Hi Andrew,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Thursday, August 12th, 2021 at 6:30 AM, Andrew Whatson wrote:

> Hi John,
>
> This package works for me as-is, just installing flatpak,
>
> xdg-desktop-portal, xdg-desktop-portal-gtk, and the patched p11-kit
>
> from #49957. I think flatpak launches the dbus services on-demand, so
>
> no additional setup is needed.

Ah, thanks for that, I was confused over the dbus aspect. You are right, just having them installed lets them get launched by flatpak applications.

> The errors about the missing OpenURI
>
> handler are fixed by this update; seeing that a version bump fixed the
>
> problem, I haven't investigated further.
>

Hmm, I didn't notice a change between the versions here. In fact, I am still getting an error that the OpenURI handler is not provided, despite seeing it provided if I launch the portal manually with --verbose. (I didn't try the change to p11-kit as I haven't run into those errors.)

> With these patches I'm successfully running Teams and Discord via
>
> flatpak with no problems.
>

Good to know!

I don't mean to derail the patch discussion, but did finally get the OpenURI handler to work, but in an unexpected way: if I launch xdg-desktop-portal manually and with --replace. Then it works. Perhaps some difference in environment variables or something if it is launched via dbus? The only large factor I can think of is that I'm not in a DE but just a WM (but have e.g. xdg-open working).

Would appreciate any further tips or bits of your setup, but seems like this is on my end and not with the package maybe. Or else needing some configuration when not in Gnome or similar.

Thanks!
John
Andrew Whatson Aug. 13, 2021, 10:38 a.m. UTC | #4
Hi John,

Yes I'm using the default gnome-desktop-service, perhaps your setup is
missing something provided by that.  The only thing I can recommend
(and maybe you're already doing this) is to launch your apps like
this:

  flatpak run --log-session-bus --log-system-bus --log-ally-bus com.foo.barapp

This gives some extra debug information from flatpak and the app,
which might help diagnose the problem.

Good luck!
Andrew

On Fri, 13 Aug 2021 at 05:18, John Kehayias
<john.kehayias@protonmail.com> wrote:
>
> Hi Andrew,
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Thursday, August 12th, 2021 at 6:30 AM, Andrew Whatson wrote:
>
> > Hi John,
> >
> > This package works for me as-is, just installing flatpak,
> >
> > xdg-desktop-portal, xdg-desktop-portal-gtk, and the patched p11-kit
> >
> > from #49957. I think flatpak launches the dbus services on-demand, so
> >
> > no additional setup is needed.
>
> Ah, thanks for that, I was confused over the dbus aspect. You are right, just having them installed lets them get launched by flatpak applications.
>
> > The errors about the missing OpenURI
> >
> > handler are fixed by this update; seeing that a version bump fixed the
> >
> > problem, I haven't investigated further.
> >
>
> Hmm, I didn't notice a change between the versions here. In fact, I am still getting an error that the OpenURI handler is not provided, despite seeing it provided if I launch the portal manually with --verbose. (I didn't try the change to p11-kit as I haven't run into those errors.)
>
> > With these patches I'm successfully running Teams and Discord via
> >
> > flatpak with no problems.
> >
>
> Good to know!
>
> I don't mean to derail the patch discussion, but did finally get the OpenURI handler to work, but in an unexpected way: if I launch xdg-desktop-portal manually and with --replace. Then it works. Perhaps some difference in environment variables or something if it is launched via dbus? The only large factor I can think of is that I'm not in a DE but just a WM (but have e.g. xdg-open working).
>
> Would appreciate any further tips or bits of your setup, but seems like this is on my end and not with the package maybe. Or else needing some configuration when not in Gnome or similar.
>
> Thanks!
> John
John Kehayias Aug. 17, 2021, 2:35 a.m. UTC | #5
Hi Andrew,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, August 13th, 2021 at 6:38 AM, Andrew Whatson wrote:

> Hi John,
>
> Yes I'm using the default gnome-desktop-service, perhaps your setup is
>
> missing something provided by that. The only thing I can recommend
>
> (and maybe you're already doing this) is to launch your apps like
>
> this:
>
> flatpak run --log-session-bus --log-system-bus --log-ally-bus com.foo.barapp
>
> This gives some extra debug information from flatpak and the app,
>
> which might help diagnose the problem.
>

I finally figured it out! It was quite a ride of diving into dbus, strace, ... in the end, the answer was right in front of me from xdg-desktop-portal --verbose output. XDG_DESKTOP_PORTAL_DIR needs to just be a single directory. Both this package and xdg-desktop-portal will add (the same directory) to this variable, and it chokes on that. Why that means some interfaces are registered but not others, I don't know. The output isn't clear as it will list the variable value as where it is loading from, but no follow-up that it did load portals.

So, I think upstream should support this environment variable having multiple entries, not that I think it is really needed, but should handle it (or error gracefully). Practically though, we only need it set once. I'll file a bug upstream.

Should we just have it in xdg-desktop-portal? The gtk, and other backends, would really only make sense used with xdg-desktop-portal if I understand correctly. So as long as their portals go in the same place, that should be fine. In my case, with this and xdg-desktop-portal installed, XDG_DESKTOP_PORTAL_DIR had the same entry twice, something like /path/to/profile/share/xdg-desktop-portal/portals

If you agree, we should update both the gtk and wayland package definitions to not have this search path set. And perhaps a note in the description that these backends are meant to be used with the main portal (and the main portal needs at least one to work? not sure).

Thanks!

John
John Kehayias Oct. 25, 2021, 7:39 p.m. UTC | #6
Updated to 1.10.0 as part of https://issues.guix.gnu.org/51100

Note that I also propagated xdg-desktop-portal as this fixes the bug I mentioned earlier in this thread. I didn't see a response from upstream about better handling of XDG_DESKTOP_PORTAL_DIR but exporting it only once in our packages fixes the problem.
John Kehayias Oct. 25, 2021, 7:41 p.m. UTC | #7
Empty Message
diff mbox series

Patch

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 693a79c738..9f6810472b 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2349,7 +2349,7 @@  and others.")
 (define-public xdg-desktop-portal-gtk
   (package
     (name "xdg-desktop-portal-gtk")
-    (version "1.7.1")
+    (version "1.8.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -2358,7 +2358,7 @@  and others.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "183iha9dxmvprn99ymgz17jx1lyn1fj5jyj6ghxl716zn9mxmird"))))
+                "0987fwsdgkcd3mh3scvg2kyg4ay1rr5w16js4pl3pavw9yhl9lbi"))))
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:phases