Skip to content
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

Default application from host environment is ignored, "Open With" doesn't always show. #436

Open
pklapperich opened this issue Jul 20, 2023 · 0 comments

Comments

@pklapperich
Copy link

Using Flatpak 1.15.4, xdg-desktop-portal-gtk 1.14.1-1, and xdg-desktop-portal 1.16.0-3. The only Flatpak app I have right now is LibreOffice org.libreoffice.LibreOffice 7.5.4.2 and its dependencies. My desktop environment is XFCE4 4.18.1-1.

My default application for application/pdf on the host environment is master pdf:

$ xdg-mime query default application/pdf
masterpdfeditor4.desktop

From inside the flatpak, no default is reported:

$ flatpak run --command=sh org.libreoffice.LibreOffice
$ gio mime application/pdf
No default applications for “application/pdf”

Both xdg-desktop-portal and xdg-desktop-portal-gtk user services are running (or if not, start immediately when I click links).

I assume this is all normal so far.


The weirdness started when I first tried opening a file://blah.pdf URL from libreoffice calc. Initially I was shown the Open With dialog every time I clicked a link to a PDF. Eventually I was never shown the Open With dialog and it was opening with Okular, even though my default in XFCE is set to Master PDF.

image


Steps to Reproduce

  1. On the host, remove the desktop-used-apps "permission" for PDFs from libreoffice:
    flatpak permission-remove desktop-used-apps application/pdf org.libreoffice.LibreOffice
  2. ctrl+click a link in LibreOffice Calc and the Open With dialog opens with MasterPDF selected, which is the default app according to XDG on the host environment.
  3. Select double click any app or select an app and click "OK" to launch with that app.
  4. Repeat steps 2-3 until bored. Everything normal here.
  5. select okular and click ok (or double click okular).
  6. okular opens the file.
  7. ctrl+click in libreoffice again and the dialog opens with Okular selected
  8. select master pdf (or gimp or firefox) and then double click okular.
  9. okular opens the file.
  10. Ctrl+click in libreoffice again and okular opens the file without showing the Open With dialog.

Okular is now used as the default from LibreOffice regardless of what's set as the default in the host environment. This remains until step 1 is repeated.

Additional Observations
After steps 3 and 5 the desktop-used-apps permission for PDFs is changed on the libreoffice package. I understand that's correct and expected.

Expected Behaviors

  • a weird combination of actions shouldn't make something behave as the default app
  • there is a default app in the host environment, that should be used what's used. I don't think the Open With dialog should ever be shown, should it?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant