Bug 475995 - Can't find KDE applications when distro locates their desktop files in a prefixed subfolder of /usr/share/applications; normal "Open With" dialog works fine
Summary: Can't find KDE applications when distro locates their desktop files in a pref...
Status: REPORTED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-23 08:05 UTC by Oleg Solovyov
Modified: 2023-10-27 14:57 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Solovyov 2023-10-23 08:05:33 UTC
1. Open Telegram-desktop (downloaded from official site)
2. Find and open a PDF file
2.1 A dialog window may open, asking which application to use.
There's no Okular there
2.2 Type "okular" in search bar
okular appears but does not run with the following diagnostics:

$ /usr/libexec/xdg-desktop-portal -rv
XDP: Opening app chooser
XDP: Received choice org.kde.okular
XDP: Cannot launch org.kde.okular.desktop because desktop file does not exist

'kf5-' prefix is missing, GLib maintainers refused to fix this on their side:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3653
Comment 1 Nate Graham 2023-10-23 18:41:57 UTC
From what I can tell by https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3653#note_1873641, this seems like it's caused by a packaging issue in your distro, which places desktop files in subdirectories. This is supported by the spec, but in practice it's such a niche feature that all sorts of things are going to break, because it makes the .desktop files names non-deterministic.

Are you suggesting that the code in the KDE desktop portal is out of compliance with that spec and providing .desktop filenames incorrectly, such that clicking on Okular in the app chooser window ought to return kf5-org.kde.okular.desktop, but instead it returns org.kde.okular.desktop and fails?
Comment 2 Oleg Solovyov 2023-10-24 09:16:43 UTC
> clicking on Okular in the app chooser window ought to return kf5-org.kde.okular.desktop, but instead it returns org.kde.okular.desktop and fails?

You understood this correctly.
Comment 3 Nate Graham 2023-10-24 21:22:48 UTC
Ok. Does it reproduce from the non-portal "Open With" dialog?
Comment 4 Oleg Solovyov 2023-10-25 07:14:42 UTC
(In reply to Nate Graham from comment #3)
> Ok. Does it reproduce from the non-portal "Open With" dialog?

Not tested.
Comment 5 Oleg Solovyov 2023-10-25 07:20:40 UTC
(In reply to Nate Graham from comment #3)
> Ok. Does it reproduce from the non-portal "Open With" dialog?

How to invoke "non-portal" dialog?
Comment 6 Nate Graham 2023-10-25 13:51:58 UTC
1. Open a distro-packaged version of Dolphin (not from Flatpak)
2. Find a PDF file
3. Right-click > Open With > Other
Comment 7 Oleg Solovyov 2023-10-25 14:45:03 UTC
(In reply to Nate Graham from comment #6)
> 1. Open a distro-packaged version of Dolphin (not from Flatpak)
> 2. Find a PDF file
> 3. Right-click > Open With > Other

It works
Comment 8 Nate Graham 2023-10-26 21:09:44 UTC
Ok, then the problem is that somehow the portal is giving us the wrong desktop file name for Okular.

Does this reproduce for other apps in the portal "open with" dialog, or only Okular? If it's only Okular, I'm suspecting some kind of issue with the alias parsing.
Comment 9 Oleg Solovyov 2023-10-27 07:30:33 UTC
(In reply to Nate Graham from comment #8)
> Ok, then the problem is that somehow the portal is giving us the wrong
> desktop file name for Okular.
> 
> Does this reproduce for other apps in the portal "open with" dialog, or only
> Okular? If it's only Okular, I'm suspecting some kind of issue with the
> alias parsing.

I suspect yes, but I don't have where to reproduce yet.
It could be reproduced on a fresh-installed distro (haven't tried neon)