Firefox will not use KDE dialogs and system applications and instead only uses GTK applications
I am running RHEL 7 and KDE4 with Firefox Nightly.
Firefox will not use KDE/Qt dialog boxes or system applications. For example: when showing the downloaded file list (Ctrl + Shift + y) and clicking the folder icon to show the file's location, firefox will freeze for several seconds before opening a window in Nautilus.
I have found discussions of this problem that span seemingly a decade without a simple step-by-step guide or an updated solution. Answers range from: editing =mimeinfo.cache= file for the =inode.directory= line, editing items in =defaults.list= file; setting the =GTK_USE_PORTAL=1= variable (somewhere) and then changing various =about:config= settings.
It's just confusing and exhausting tracking this down. Is it possible to get firefox to play nicely with KDE? Nothing that I have tried so far seems to have worked, but I'm honestly not sure where this setting would live, or magic bash incantation I need to run.
I know this seems minor, but having just switched back over to firefox to chrome, it seems very jarring seeing the GTK dialogs that do not play nicely with the rest of my desktop/workflow (i.e., I do not want to start a Gnome vs KDE flamewar, but rather: I'm used to dolphin and how it works and make heavy use of the embedded terminal within dolphin windows or drag&drop files into the Qt open dialog box which "drops" as a file path ... I have no idea what happens if I drag something into the GTK open dialog box)
All Replies (5)
Hi,
To use the native file picker on KDE, you will need to:
1. Install both `xdg-desktop-portal` and `xdg-desktop-portal-kde` packages 2. Add `export GTK_USE_PORTAL=1` to your `~/.bashrc` file 3. Reload your session or reboot your computer
However, as far as I know, this doesn't include the Download and Library windows that are builtin components in Firefox. So I'm afraid you're stuck with the GTK-ish theme for those windows.
Danny, thank you so much for your help! I really appreciate the simple instructions!
I do have `xdg-desktop-portal` installed, but did not have an `xdg-desktop-portal-kde` package available. For other RHEL users reading this, I found [https://copr.fedorainfracloud.org/cop.../xdg-desktop-portal-kde/[this EPEL repository]] which installed the `xdg-desktop-porgal-kde` package. After twiddling with the `widget.use-xdg-desktop-portal` variable and restarting my system (with the `.bashrc` environment variable set), I do now have a non-GTK dialog when opening/saving files. It's still not the actual KDE system one, but is better than the GTK/Nautilus one I had before.
The issue regarding the "Library" window is not quite solved though. I understand the Library component itself is a part of firefox, but if I secondary click on a downloaded item and select "Open containing folder" it will open in nautilus. If I select---as an example---a downloaded PDF file and select "Open In system viewer" the PDF will open in ... well, I'm not quite sure, but a PDF viewer called "Document Viewer" as opposed to Okular. From a command line, running `xdg-open` and passing either a folder or PDF would open in dolphin or okular respectively. These are either hardcoded in firefox (which I would assume is not the case) or are being picked up from somewhere else, that is different from the xdg portal settings.
So again, thank you for your help. I'm not 100% sure if this fully solved the problem or not. It certainly is still not fully integrated with KDE, but that may just be 'by design' for linux folks.
stewart.t দ্বারা পরিমিত
Danny, thank you so much for your help! I really appreciate the simple instructions!
I do have `xdg-desktop-portal` installed, but did not have an `xdg-desktop-portal-kde` package available. For other RHEL users reading this, I found [https://copr.fedorainfracloud.org/cop.../xdg-desktop-portal-kde/[this EPEL repository]] which installed the `xdg-desktop-porgal-kde` package. After twiddling with the `widget.use-xdg-desktop-portal` variable and restarting my system (with the `.bashrc` environment variable set), I do now have a non-GTK dialog when opening/saving files. It's still not the actual KDE system one, but is better than the GTK/Nautilus one I had before.
The issue regarding the "Library" window is not quite solved though. I understand the Library component itself is a part of firefox, but if I secondary click on a downloaded item and select "Open containing folder" it will open in nautilus. If I select---as an example---a downloaded PDF file and select "Open In system viewer" the PDF will open in ... well, I'm not quite sure, but a PDF viewer called "Document Viewer" as opposed to Okular. From a command line, running `xdg-open` and passing either a folder or PDF would open in dolphin or okular respectively. These are either hardcoded in firefox (which I would assume is not the case) or are being picked up from somewhere else, that is different from the xdg portal settings.
So again, thank you for your help. I'm not 100% sure if this fully solved the problem or not. It certainly is still not fully integrated with KDE, but that may just be 'by design' for linux folks.
stewart.t said
if I secondary click on a downloaded item and select "Open containing folder" it will open in nautilus. If I select---as an example---a downloaded PDF file and select "Open In system viewer" the PDF will open in ... well, I'm not quite sure, but a PDF viewer called "Document Viewer" as opposed to Okular.
You can change the default application Firefox uses to open a file type (e.g. PDF):
1. Click the menu button Fx89menuButton and select Settings. 2. In the General panel, go down to the Applications section. 3. Find Portable Document Format (PDF) in the list and click on the entry to select it. 4. Click on the arrow under the Action column for the above entry and select the PDF viewer you wish to use from the drop-down menu.
Hopefully, this will works! :)
I'm extremely hesitant to say that this issue is "solved" as it feels like the same sense that a band-aid "solves" open wounds ... but it does certainly help.
At this point everything is usable and not terribly frustrating. The only annoying item at this point is the GTK open/file-select dialogs, but it mostly tends to work.
I solved the lion share of my issues by finally finding that firefox was getting which applications to use from the file at `~/.config/mimeapps.list` After making a `firefoxnightly.desktop` file in `~/.local/share/applications` I could simply edit items like
x-scheme-handler/mailto=firefoxnightly.desktop
to let my web (read: gmail) mail client handle mail links. Otherwise, it was an endless cycle of an older firefox opening links.
So again, its all mostly usable now and everything seems to work, and I (or hopefully anyone else who stumbles on this) feel like I now at least have some control as to how mime apps are handled by firefox on my system. Thank you very much for your time @Danny