After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758529 - Try not to open PDFs in GIMP
Try not to open PDFs in GIMP
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
3.16.x
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-23 09:47 UTC by Karl Palsson
Modified: 2016-01-20 13:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
documents: Open in the default recommended app (1.89 KB, patch)
2016-01-04 15:56 UTC, Bastien Nocera
committed Details | Review

Description Karl Palsson 2015-11-23 09:47:09 UTC
It's bad enough that "documents" is what the winkey->search chooses to open a pdf with in the first place, but now the menu item to "open" is opening pdfs in gimp.  

In what world do I want to open a 300 page pdf in gimp?
Comment 1 Bastien Nocera 2015-12-08 15:14:03 UTC
(In reply to Karl Palsson from comment #0)
> It's bad enough that "documents" is what the winkey->search chooses to open
> a pdf with in the first place, but now the menu item to "open" is opening
> pdfs in gimp.  

You can turn that off in the Search panel of the control center. Given that you opened the PDF from the "Documents" section of the search results, which is provided by gnome-documents (eg. "Documents"), then it's kind of expected it opens in Documents.

You can turn off Documents search and turn on Files, and it will open in the default handler for PDF files.

> In what world do I want to open a 300 page pdf in gimp?

What's the output of:
gvfs-mime --query application/pdf
on your system?

Does it happen for every PDF file?
Comment 2 Karl Palsson 2016-01-04 13:33:47 UTC
Turning off documents search "works" but files search only shows up three results, and having 6 results instead of 3 is better than nothing.  But that's a different bug....

I can't tell you what the output of gvfs-mime _was_ because I hacked on /usr/share/applications/mimeinfo.cache to make this problem "go away", but yes, it was happening for all pdfs.

gvfs-mime --query application/pdf
karlp@cuth:~$ gvfs-mime --query application/pdf
Default application for 'application/pdf': evince.desktop
Registered applications:
	evince-previewer.desktop
	evince.desktop
	pdfmod.desktop
Recommended applications:
	evince-previewer.desktop
	evince.desktop
	pdfmod.desktop
karlp@cuth:~$ 

I was doing this on the last day before my holidays, I could probably fiddle with the mimeinfo.cache file again to change the order there, I definitely removed some gimp entries.

However, now, if I select a pdf from the "Documents" search provider, and "open" it, I get it opened as evince preview....

Which is the "top of the list" but not the "Default application"  Still feel this is bad behaviour of the "Documents" app.
Comment 3 Bastien Nocera 2016-01-04 14:22:27 UTC
(In reply to Karl Palsson from comment #0)
> It's bad enough that "documents" is what the winkey->search chooses to open
> a pdf with in the first place, but now the menu item to "open" is opening
> pdfs in gimp.  

Which menu item is this? Because gnome-documents already used the default application for opening PDFs, not the first one in the list.
Comment 4 Karl Palsson 2016-01-04 15:38:10 UTC
If it did the right thing I wouldn't be filing bugs now would I?

winkey->"Search" for a title of a PDF, click on it from the "Documents" provider -> Click the "three horizontal bars" icon in the top right, choose "Open" and get.... evince preview!

choose the same file from the "Files" search provider, and it opens in evince proper.
Comment 5 Bastien Nocera 2016-01-04 15:54:54 UTC
(In reply to Karl Palsson from comment #4)
> If it did the right thing I wouldn't be filing bugs now would I?

Well, you could be using a version prior to the fixes from:
https://bugzilla.gnome.org/show_bug.cgi?id=740978

Or with them, and now I see what the problem is ;)

> winkey->"Search" for a title of a PDF, click on it from the "Documents"
> provider -> Click the "three horizontal bars" icon in the top right, choose
> "Open" and get.... evince preview!
> 
> choose the same file from the "Files" search provider, and it opens in
> evince proper.
Comment 6 Bastien Nocera 2016-01-04 15:56:19 UTC
Created attachment 318214 [details] [review]
documents: Open in the default recommended app

We still don't want to simply choose the default app as the one opening
files, as it could lead to ePubs being opened in the archive manager.
But we also want to make sure that the default settings are respected.

Prefer the default application if it's part of the recommended
applications, or the first recommended application failing that.
Comment 7 Debarshi Ray 2016-01-04 18:21:13 UTC
Review of attachment 318214 [details] [review]:

Thanks, Bastien. Looks good to me.
Comment 8 Debarshi Ray 2016-01-04 18:25:11 UTC
Please cherry-pick all the way down to gnome-3-16, since the patches for bug 740978 were merged during the 3.15/3.16 cycle.
Comment 9 Debarshi Ray 2016-01-05 10:37:18 UTC
Comment on attachment 318214 [details] [review]
documents: Open in the default recommended app

Pushed to master, gnome-3-18 and gnome-3-16.
Comment 10 Debarshi Ray 2016-01-05 10:37:50 UTC
Thanks for your patience and efforts, Karl!