Bug 398041 - Okular flatpak on GNOME: Cannot open documents "normally"
Summary: Okular flatpak on GNOME: Cannot open documents "normally"
Status: RESOLVED UPSTREAM
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.49.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL: https://github.com/flatpak/xdg-deskto...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-29 22:03 UTC by 157ydvplnj0p
Modified: 2018-09-01 02:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Okular error screenshots (63.67 KB, application/pdf)
2018-08-29 22:03 UTC, 157ydvplnj0p
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 157ydvplnj0p 2018-08-29 22:03:28 UTC
Created attachment 114690 [details]
Okular error screenshots

I'm running Okular from flatpak (flathub.org) on Debian 9, GNOME 3.22. I am unable to open files in Okular "normally" (by double-clicking, or dragging and dropping into an open Okular Window). 

But I am able to open files if I browse to a file from Okular's File > Open menu (Ctrl+O). 

Upon making annotations, when I try to save any changes, the file-save dialog box opens in the background and I get a notification pop-up saying 

Xdg-desktop-portal-gtk
"Save As" is ready

Also, under 'Open Recent' file list, the path to the file shows up as /run/user/1000/doc/<some number>/<filename>, instead of the actual path. (But I am able to open files already in the 'Open Recent'.)

I looked some previous bug reports and discussions. Upon running "systemctl --user status xdg-desktop-portal.service", I get "Unit xdg-desktop-portal.service could not be found." 

xdg-desktop-portal-kde is not installed and I am unable to find it in Debian Stretch or backports repositories. (I do see it on Debian testing and Sid repos.) 

I've attached some screenshots of the errors I'm getting, and would be happy to provide additional info. I'd really appreciate any help with sorting this out. 

(I'm not a software developer, just an end-user, and was unsure whether to mark this bug as 'major', 'normal', 'minor' etc. Please feel free to mark it as appropriate.)

While I'm at it, I want to thank the developers for this life-saver. Were it not for Okular, PDF file management on my Linux setups would be a nightmare.
Comment 1 Nate Graham 2018-08-30 16:31:45 UTC
Thanks for the bug report!

One issue per bug report, please. See https://community.kde.org/Get_Involved/Bug_Reporting#One_issue_per_bug_report


> "Could not change permissions" error after saving
Will be fixed by https://phabricator.kde.org/D15154

> Xdg-desktop-portal-gtk
> "Save As" is ready
This is a Flatpak or GTK portal issue, not a KDE issue.


> xdg-desktop-portal-kde is not installed and I am unable to find it in Debian
> Stretch or backports repositories. (I do see it on Debian testing and Sid repos.)
This is Debian packaging issue, not a KDE issue.


> Also, under 'Open Recent' file list, the path to the file shows up as
> /run/user/1000/doc/<some number>/<filename>, instead of the actual path.
> (But I am able to open files already in the 'Open Recent'.)

Yeah, this is messy and ugly, but sadly necessary given the interaction between GNOME's gvfs, KIO, and Flatpak. Fixing this is sort of a long-term goal that's on everyone's radar screens, but not something I can promise you relief for soon, sorry.


So let's use this bug to track this issue:

> I am unable to open files in Okular "normally" (by double-clicking, or
> dragging and dropping into an open Okular Window). 
Can you please tell me the full path to the file on your computer? Is it local, or located on another disk, a Samba share, or an NFS mount or something?

Oh, and are you using GNOME?
Comment 2 157ydvplnj0p 2018-08-30 23:42:46 UTC
Hello, 

Thanks for following up, Nate. 

I get the same error (not being able to open files directly with Okular) regardless of whether a file is in the ~/home partition or on a separate partition (on the same disk, or another disk). (All partitions I'm referring to  are LUKS-encrypted, if this information is relevant.) 

I don't get this error have on the same machine with Debian KDE and Fedora KDE set up in separate partitions. (But, on this partition where this error is showing up, I'm using GNOME 3.22.)

Flatpak: I don't want to crowd the KDE bug reporting space. If there's a separate place to post flatpak-specific issues with KDE apps, please let me know, I'd be happy to post any additional information there.

Overall, it's not unusable, just takes a bit away from an otherwise polished experience.

------
P.S.: If you are the same Nate Graham (PointiestStick) who posts about the bug-squashing spree that KDE is on, I want to say a heartfelt "Thank you". Your posts and comments on reddit give me hope that the internet may not, after all, be headed for hell. (In fact, one of your defenses against a GNOME-bashing post prompted me to try GNOME this summer, the same way I had tried KDE4 some 8 years ago wondering "Why so do people seem to hate KDE so much?". Ended up using KDE as my go-to desktop environment since then :) )
Comment 3 Nate Graham 2018-08-31 00:22:29 UTC
(In reply to 157ydvplnj0p from comment #2)
> Hello, 
> 
> Thanks for following up, Nate. 
> 
> I get the same error (not being able to open files directly with Okular)
> regardless of whether a file is in the ~/home partition or on a separate
> partition (on the same disk, or another disk). (All partitions I'm referring
> to  are LUKS-encrypted, if this information is relevant.) 
Is this true on the KDE installations as well, or only on the GNOME installation?


> I don't get this error have on the same machine with Debian KDE and Fedora
> KDE set up in separate partitions. (But, on this partition where this error
> is showing up, I'm using GNOME 3.22.)
Do you have the flatpak KDE portal package installed in either of your KDE installations?



> ------
> P.S.: If you are the same Nate Graham (PointiestStick) who posts about the
> bug-squashing spree that KDE is on, I want to say a heartfelt "Thank you".
> Your posts and comments on reddit give me hope that the internet may not,
> after all, be headed for hell. (In fact, one of your defenses against a
> GNOME-bashing post prompted me to try GNOME this summer, the same way I had
> tried KDE4 some 8 years ago wondering "Why so do people seem to hate KDE so
> much?". Ended up using KDE as my go-to desktop environment since then :) )
The one and only! :) You're very welcome, and I'm glad you're enjoying our software. Thanks for reporting this bug and helping to make it better.
Comment 4 157ydvplnj0p 2018-08-31 04:31:59 UTC
Spoke too soon. I have Okular (from Fedora's (KDE) repos) set up as my default pdf viewer; I confused that with the flatpak version, which is also installed on that same set up. On Fedora (KDE), when using the flatpak package for Okular, I'm getting the same behaviour when opening files: Right-click + Open or dragging and dropping a file onto an open Okular window gives an error ("Could not open 'file://<path/filename.pdf>'. File does not exist.") But browsing to the file through File > Open menu option in Okular (flatpak) opens files with no errors. 

I have xdg-desktop-portal-kde installed on Fedora (KDE). CTRL+Shift+S opens the file-save-as dialog box in the foreground as expected instead of in the background with a pop-up (as I see in GNOME 3.22 and 3.28).

(Additional info about the Fedora KDE setup: Plasma ver 5.13.4, KDE Frameworks 5.48.0, QT version 5.10.)

On a Fedora (GNOME 3.28.2) setup, I get the same error when trying to open files by double-clicking, but the file-save dialog box behaviour is strange: I have xdg-desktop-portal-kde installed, but the file-save dialog box still opens in the background (*right behind the Okular window*) with a pop-up message.

On the Debian (GNOME 3.22) setup, which spurred this bug report, the file save dialog box would open in the background (but not right behind Okular), so I routinely Alt-Tab my way to that dialog box.

(I don't have the Debian KDE setup with me right now, so I am unable to check on that.)

In summary:
---------------------------------------------------------------------
Fedora KDE: File open operation by double clicking/ dragging and dropping gives an error. File-Save works as expected.

Fedora GNOME (with xdg-desktop-portal-kde installed) File open operation by double clicking/ dragging and dropping gives an error. File-Save opens the Save dialog box *right behind the Okular window*.

Debian GNOME (where xdg-desktop-portal-kde is *not* installed),  File open operation by double clicking/ dragging and dropping gives an error. File-Save opens the Save dialog box in the background.

Hope this helps.
Comment 5 Nate Graham 2018-09-01 02:15:35 UTC
Thanks, that helps a lot. Since the drag-and-drop issue is consistent throughout all cases, this is https://github.com/flatpak/xdg-desktop-portal/issues/99, which is a Flatpak issue.

The issue with the save dialog opening behind the app on GNOME is a GNOME issue, so please report it to them. Thanks again!