-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create/ install dynamic launchers #1674
Comments
I assume the app which tries to use the dynamic launcher portal is a flatpak? We recently tightened the app id requirements to follow what flatpak considers a valid app id: https://github.com/flatpak/xdg-desktop-portal/blob/119aad03548f85ed249b7f21cd551f77bc74e4dd/src/xdp-app-info-flatpak.c#L173C1-L173C41 In other words, if your app is a flatpak, it should not be able to create sub-app-id's which are not valid flatpak app ids. |
Thanks, my app was using hyphens instead of underscores in the app IDs, I have fixed it now. Unfortunately, I still get the same error ( |
You might run into the 255 bytes limit. |
Thanks, but that is not the case, the total length of the desktop file's name is under 255 chars. I cannot install web apps using GNOME Web (installed via Flatpak) either. (The text of the notification gets cut off in the notification panel, so I cannot attach the full error message.) |
Moving from https://gitlab.gnome.org/GNOME/epiphany/-/issues/2616, I'll note that the same version of xdg-desktop-portal works perfectly fine for me. Clearly the call to GDesktopAppInfo hasn't changed recently. GKeyfile had some changes to locale handling here, but I doubt it's related. I think next step here is to add a call to |
What I noticed is that |
OK, but epiphany and webapps already exist if the user is using them to install web apps. |
Well, the desktop file provided in the comment is:
and it fails.
This works. So my guess is that somehow the systems of the people affected do not have the programs in their path for some reason. |
If this is meant to launch a flatpak then it's obviously wrong. When flatpak exports a .desktop as installed in the package, it does rewrite the |
Blergh, I had another look. We first pass the provided data to |
The g_desktop_app_info_new_from_keyfile function requires the the Exec line in the keyfile to be an executable (in the context of the current environment, so the portal). Flatpak apps do not have the executable on the host, but use `flatpak run`. The portal rewrites those Exec lines, but it did so after calling g_desktop_app_info_new_from_keyfile, so it would fail if whatever the Exec line specified was not a valid executable on the host. Resolves: flatpak#1674
#1682 might fix the issue here |
I was using flatpak when I tested this earlier today. For example:
this works perfectly fine with xdg-desktop-portal 1.20.0, same version that Satvik is using. |
I don't have anything technical to add, but I can confirm that if I use
in the call to dynamic_launcher_install, it does install a desktop file. The desktop file itself it useless though, because it calls 'flatpak' within the flatpak:
This is on xdg-desktop-portal 1.20.0. |
Right, if you replace Anyway, this confirms that #1682 will fix the issue. |
That won't fix the issue with Epiphany because it's implausible that the user does not have |
e: Do we know if the user is running Epiphany on the host or in a flatpak, and what the exact desktop entry is? |
Thank you. Should I replace Also, I did some testing on installing web apps through Epiphany as well. When using Epiphany installed through Flatpak, I cannot install web apps, with the same error message as the user in the epiphany gitlab issue did. Epiphany through my distro package (Debian) can install web apps in both the cases where Flatpak is and is not installed. The desktop entry is:
|
This user is running in a flatpak, so I think the non-flatpak example provided by eyekay in the comment above is not relevant. It's impossible to ask the user to provide an exact desktop entry since we can only check the generated desktop file if the portal does not reject the request. Would be very helpful if xdg-desktop-portal could print the rejected desktop file with g_debug(). Since eyekay is able to reproduce the problem, we could ask him to run a custom build of xdg-desktop-portal to test, though. When I create a web app successfully, the Exec line looks like:
eyekay, are you sure that you have Epiphany installed on your host system when you test installing the web app using the Flatpak version of Epiphany? If so, then we know #1682 will not fix the Epiphany issue. |
I didn't have Epiphany on the host when I tried the Flatpak version.
I tried doing it myself, but I couldn't figure out where it was being printed, if at all. If you can share the modified source and let me know where to look for the output, I'll be happy to help. |
I feel like we're talking past each other. On the host this shouldn't be a problem because the thing you write in Exec is a thing that got installed on the host, and it doesn't get changed by the portal. On flatpak, the problem is that the thing you write in Exec is not visible on the host (or if it is, then it's by accident). We check that it's executable before we rewrite it to
I'm going to guess that you also installed epiphany on the host. |
The most helpful thing would be to test the PR. If it doesn't fix things, we can try to dig deeper. |
I don't know how I to do that :( I don't know how to build a debian package from your PR and I'm not sure how else I can test it. |
OK, then swick is probably correct. Please test it again now that you do have it installed, and if the bug goes away, then we know swick's diagnosis is correct. |
It does work now, yes |
The g_desktop_app_info_new_from_keyfile function requires the the Exec line in the keyfile to be an executable (in the context of the current environment, so the portal). Flatpak apps do not have the executable on the host, but use `flatpak run`. The portal rewrites those Exec lines, but it did so after calling g_desktop_app_info_new_from_keyfile, so it would fail if whatever the Exec line specified was not a valid executable on the host. Resolves: flatpak#1674
Operating System
Debian sid
XDG Desktop Portal version
Other
XDG Desktop Portal version (Other)
1.20.0
Desktop Environment
GNOME
Desktop Environment (Other)
No response
Expected Behavior
The dynamic launcher should be installed successfully.
Current Behavior
I get an error that the desktop entry given to install() is not valid.
g-io-error-quark: GDBus.Error:org.freedesktop.portal.Error.InvalidArgument: Desktop entry given to Install() not valid (36)
Steps to Reproduce
portal.dynamic_launcher_install()
fails with this error in the terminal:g-io-error-quark: GDBus.Error:org.freedesktop.portal.Error.InvalidArgument: Desktop entry given to Install() not valid (36)
Anything else we should know?
This is the code I am running (python):
desktop_file = '[Desktop Entry]\nType=Application\nExec=webapps {}\nTerminal=false\nCategories=Network;'.format(app_id)
...
portal.dynamic_launcher_install(token, "net.codelogistics.webapps." + app_id + ".desktop", desktop_file)
where
app_id
is in the format "webapp-{UUID}".This was working fine till a few months ago in both GNOME and KDE. I don't know whether this is a bug in xdg-desktop-portal or libportal, or in my app.
The text was updated successfully, but these errors were encountered: