unfortunately I can’t open PDF attachments in geary. With other file types it works without problems. Saving PDF files is also possible.
I use geary 40.0 under ubuntu 20.04 installed via flatpak.
I hope you have a solution for me.
Can you open the pdf file directly from the file browser (“Files” app on GNOME)? What PDF reader are you using? Since you can open other file types, it sounds like your PDF reader doesn’t “say” it supports PDF file types.
I use “evince” for viewing PDF files. With the ubuntu file manager “natilus” there is no problem. I can open the PDF files with a double click. Some time ago there was no problem.
Is there a way to configure what program geary uses for opening PDF files?
Thanks Stefan
Sorry for the delay, I was busy with some other things
Well Geary already tries opening with the default assigned normally so no configuration should be needed. I tried sending myself a test pdf as mail attachment, then opening it in Geary proposed me a prompt between LibreOffice Impress and Evince (this one shows only once though, as it remembers the choice made), and I was able to get the PDF opened in Evince like that. I’m on Fedora 34 though, not sure if that’s important.
Does running xdg-mime query default application/pdf in a terminal gives you evince?
Can you give the output of the following command, flatpak permissions desktop-used-apps | grep -i geary, which checks which default app is assigned for each file type? For example here it gives me (with other lines): desktop-used-apps application/pdf org.gnome.Geary org.gnome.Evince,3,3 0x00.
Because flatpak applications are sandboxed, they can’t access various things directly like your files or the camera and microphone (unless it asks explicit permissions as visible in GNOME Software, or prompts you to e.g. choose a file). To have a more safe way of letting it access such things, Flatpak is accompagnied by a so-called “portal” that provides those various prompts (e.g. file chooser or saver) that ensures applications can only access what the user has agreed to. So can you provide the output of the following command, G_MESSAGES_DEBUG=all /usr/libexec/xdg-desktop-portal --replace | grep -iE '(handler|pdf)' --context=5, which should show how the portal is handling the request to open the PDF file?
Also, are you using GNOME?
Those few questions are to understand what might be wrong, to diagnosis and hopefully fix the problem.
There is an error in the output of the xdg-desktop-portal call, but I don’t understand this.
When I call it from the commandline, there is no problem:
stefan@stefan-Inspiron-13-5378:~$ evince /home/stefan/.var/app/org.gnome.Geary/data/geary/goa_account_1550602475_0/attachments/17568/6620/Rauchwarnmelder\ Vereinshaus\ LKG\ Scheideweg\ 28\ Wartung\ 2021.05.pdf
I use ubuntu 20.04 and this I thin also use gnome.
It’s trying to use evince.desktop which doesn’t exist (as shown with assertion ‘G_IS_DESKTOP_APP_INFO (info)’ failed) which of course doesn’t work - it should be using org.gnome.Evince.desktop (and you’ll note the log observes Default handler org.gnome.Evince)
I would rebase both xdg-desktop-portal and xdg-desktop-portal-gtk in Ubuntu 20.04 to the latest 1.8.x versions. Both components have had a bit of a rough ride recently, and I’m not surprised you wound up with bad versions. afaik their current releases are both currently in good shape.