[KDE/Flatpak] Firefox doesn't open downloaded files in Qt applications
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
People
(Reporter: mi2rivtj, Unassigned, NeedInfo)
References
Details
Attachments
(5 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0
Steps to reproduce:
Download a JPG image or a PDF file and open it.
Actual results:
Firefox will open in the wrong application. If the user installed a GTK app like Chromium or GIMP, Firefox will open images in Chromium and PDFs in GIMP instead of opening in Gwenview and Okular respectively.
Expected results:
Firefox should detect Qt applications when opening downloaded files.
PDF file opening in GIMP (GTK) instead of Okular (the default Qt app in KDE for opening PDFs).
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::File Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 3•4 years ago
|
||
Hi,
I cannot reproduce this issue on Fx 89.0 using Ubuntu 20.
Can you please check on Firefox > Hamburger menu> Settings > General > Applications > if "PDF" and "WebP Image" have the option "Open in Firefox". Maybe this issue occurs on your machine because the Chromium and GIMP apps are set as default on your system.
Comment 5•3 years ago
|
||
Karl, do you know if this is expected on KDE since we usually rely on gtk libraries?
Comment 6•3 years ago
|
||
The reported behavior is not expected because GTK and KDE use a similar freedesktop convention for MIME type to application mappings.
On my KDE system, Firefox respects the KDE "File Associations" settings unless I have a preferred application set in Firefox or there is a ~/.mailcap file.
mailcap files are an older mechanism. I suspect we would surprise fewer users if we used mailcap only when the freedesktop/GTK mechanism failed to find an app.
mi2rivtj, if you load https://iv.iiarjournals.org/content/invivo/35/3/1313.full.pdf and click on the "Download" icon beside the "Print" icon in the PDF viewer, then what do you see beside "Open with"? Letter case is relevant here and I'd like to know whether you see "(default)".
Also, do you have an application/pdf line in ~/.mailcap?
@Karl Tomlinson (:karlt) Just did this. It opens in calligra (an ebook reader) despite Okular being installed.
I'm using Kubuntu 21.04 but the same problem happens in KDE Neon.
Pictures here are opening in ImageMagick instead in Gwenview.
Updated•3 years ago
|
Comment 9•3 years ago
|
||
Comment on attachment 9227448 [details]
firefoxbug.mp4
Ah, thanks. "System Handler" indicates that gtk_show_uri()
is being used. Presumably that uses a Flatpak API, and so I don't know how this could be resolved in Firefox.
Comment 10•3 years ago
|
||
(In reply to mi2rivtj from comment #7)
It opens in calligra (an ebook reader) despite Okular being installed.
Have you checked in the "File Associations" settings that Okular is preferred?
Reporter | ||
Comment 12•3 years ago
|
||
Gwenview is also the preferred app to open JPG files. JPG images open in ImageMagick here.
Comment 13•3 years ago
|
||
Jan, any ideas why Flatpak would not be using the user's preferred application for the MIME type?
Updated•3 years ago
|
Reporter | ||
Comment 14•3 years ago
|
||
This doesn't happen in Fedora 34 KDE.
Comment 15•3 years ago
|
||
(In reply to Karl Tomlinson (:karlt) from comment #9)
Comment on attachment 9227448 [details]
firefoxbug.mp4Ah, thanks. "System Handler" indicates that
gtk_show_uri()
is being used. Presumably that uses a Flatpak API, and so I don't know how this could be resolved in Firefox.
It appears that no bugzilla component is associated with this file, but I suspect all the people who know about it are probably working in the GTK integration component, so tentatively moving it there instead of file handling - the frontend team doesn't have the expertise to figure out what is happening here.
Reporter | ||
Comment 16•3 years ago
|
||
But why this bug doesn't happen in the Fedora?
Reporter | ||
Comment 17•3 years ago
|
||
A solution has been found!
I'm going to quote this commentmade in Reddit:
The root of the problem is: KDE does not initialize the XDG file associations file ~/.config/mimeapps.list with its defaults. Instead KDE relies on its own launch executable. Since Thunderbird / GTK apps parse that file to get defaults it shows a random app that supports opening PDF files.
A quick workaround to solve this is forcing KDE to generate the entry for PDF files. You can do that by changing file association order to something different than the default applying it and then turning the ordering back to Okular-first in System Settings -> File Associations.
It is an oddity left from KDE4 days. It allows people to try out KDE without ruining GTK based desktop file associations but causes problems like this when GTK apps are used under KDE desktop.
It's not a problem with Firefox, but with KDE itself, which might explain why in Fedora this issue doesn't happen.
Reporter | ||
Comment 18•3 years ago
|
||
I did this workaround and files are opening in the right application now!
Updated•3 years ago
|
Description
•