This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Browser download window not what I expect

Tags: None
(comma "," separated)
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
I have this really weird symptom. The backstory is that I reinstalled Ubuntu 22.04 LTS and KDE/Plasma 5. I then made sure my Brave browser and Firefox browser user data folders were in the right locations and fired the browsers up. Everything worked fine, and I had very little to fix.

Fast forward a month or two; and on the few occasions that I needed to save a file from the Internet, I noticed that the download window was rather spartan. I didn't think much of it until I encountered a bug in it that began to drive me crazy.

Here is the window:

Image

And the symptom I encountered was that when I attempt to give the file a name, the search is triggered instead and won't go away. So I have to basically type my desired filename into the search and then literally copy & paste it to the name field in order to save.

So this symptom drove me to investigate why this spartan window was appearing in the first place. I thought maybe this was a setting in Brave browser, but I found none. I then tested with Firefox browser, and encountered the same symptom! So then I thought it must be a setting in KDE/Plasma, so I dug around in the settings and tried both Dolphin and Files for "File manager" default app, but without a change.

Finally I reached out to a coworker who is on a different distro but also uses KDE/Plasma 5. He also uses Brave browser, and his window looks like what I remember I used to have:

Image

Does anyone recognize my window and know how to get back to the other one, the same one my coworker has? The only clue I was able to find is that when I use Window Management > Window Rules > Add New... > Detect Window Properties, the "Window class (application)" field is "xdg-desktop-portal-gnome" and the "Whole window class" is "xdg-desktop-portal-gnome xdg-desktop-portal-gnome".

UPDATE Here are my system details:
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
plasmashell 5.24.4
Qt: 5.15.3
KDE Frameworks: 5.92.0
kf5-config: 1.0

Last edited by TitaniumCoder477 on Thu Jun 09, 2022 10:46 pm, edited 1 time in total.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
How is this related to KDE or Plasma?


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
Mamarok wrote:How is this related to KDE or Plasma?

As I demonstrated in the details, the issue is not browser-specific. Therefore, it is specific to the desktop or some default in KDE or Plasma that I am trying to identify.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

Not a topic for the KDE Community. Have a look at Canonicals Snap and its restrictions. I think you can't access the desktop environments default file dialog using Snap.
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
koffeinfriedhof wrote:Hi!

Not a topic for the KDE Community. Have a look at Canonicals Snap and its restrictions. I think you can't access the desktop environments default file dialog using Snap.


Please explain to me why this is "not a topic for KDE Community." From my point of view, I am using KDE and Plasma, which is what this forum is about. I have also verified that two completely different browsers produce the same window when attempting to download a file. Am I incorrect in assuming this window is produced by the underlying desktop system, i.e. KDE and/or Plasma?
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
Here is an additional clue:

My download window's "Window class (application)" is xdg-desktop-portal-gnome.
But my coworker's download window's "Window class (application)" is xdg-desktop-portal-kde.

Does anyone know where this type of setting is where I need to change it from gnome, which I assume was set as default by the OS or something, to kde?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hey ;)
TitaniumCoder477 wrote:Please explain to me why this is "not a topic for KDE Community." From my point of view, I am using KDE and Plasma…

Firefox is a GTK-Browser and not related to KDE/Plasma, but the main thing is Snap. That is a special proprietary Canonical product and so it would fit better in any Ubuntu forum. I did never use it but read a lot of issues with it like the missing native file dialog you have.

The KDE Community cannot do anything to change Snap or Firefox, thats why I think this topic would be better posted in an Ubuntu forum, probably as a bug report on launchpad.
As Qt is barely supported in Ubuntu it also is not a good idea to use the native browsers like Konqueror, Falkon, or similar for security reasons. Ubuntu officially only supports Firefox and delivers it only as Snap. You may change this of course as you can change anything, but then "you are on your own".

Just search for e.g. "firefox snap bug launchpad" and enjoy the fun ;-) Theres a lot of stuff broken.
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
koffeinfriedhof wrote:Hey ;)
TitaniumCoder477 wrote:Please explain to me why this is "not a topic for KDE Community." From my point of view, I am using KDE and Plasma…

Firefox is a GTK-Browser and not related to KDE/Plasma, but the main thing is Snap. That is a special proprietary Canonical product and so it would fit better in any Ubuntu forum. I did never use it but read a lot of issues with it like the missing native file dialog you have.

The KDE Community cannot do anything to change Snap or Firefox, thats why I think this topic would be better posted in an Ubuntu forum, probably as a bug report on launchpad.
As Qt is barely supported in Ubuntu it also is not a good idea to use the native browsers like Konqueror, Falkon, or similar for security reasons. Ubuntu officially only supports Firefox and delivers it only as Snap. You may change this of course as you can change anything, but then "you are on your own".

Just search for e.g. "firefox snap bug launchpad" and enjoy the fun ;-) Theres a lot of stuff broken.


I installed Brave from their own website following the Debian 9+, Ubuntu 16.04+ and Mint 18+ instructions which pull a native package from the Brave package repo. So no Snap involved there.

Figure 1: Brave

Image

It does look like my instance of Firefox is a Snap package.

Figure 2: Firefox

Image

So based on the common symptom, I don't really think this has to do with Snap. Today I did some investigation into xdg-settings and in particular default-url-scheme-handler, and xdg-desktop-portal-gnome and xdg-desktop-portal-kde. This is the github repo for xdg-desktop-portal-kde, which is the window that I am trying to get the browsers to use: https://github.com/KDE/xdg-desktop-portal-kde

If you go there, you can see that this is simply "a backend implementation for xdg-desktop-portal..." If you follow the link there, you will arrive at https://github.com/flatpak/xdg-desktop-portal, on which you will see GTK, GNOME, KDE, and others listed as backends. I am trying to get the KDE backend to work. I am trying to figure out why the GNOME backend is defaulting, even when I am in KDE/Plasma. This is why I am here. If I go to some other forum, they will have every reason to say, "Bro! You're using the KDE/Plasma desktop. Go ask them!"
dzon
Registered Member
Posts
493
Karma
3
I have a partition with kubuntu 22.04, no snaps, no snapd whatsoever, regular firefox. Firefox download window does the set gtk theme. I added another gtk app in the screenshot to compare. https://imgur.com/a/fh6gHFi
Brave, however, as most chromiums, will use the qt window as where a download should be saved. https://imgur.com/a/pvxiYj7. As far as I recall correctly, firefox always used the gtk window. Is kdialog installed?


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
I don't use firefox. It seems there was an option to change the file dialog (ui.allow_platform_file_picker = false) but this does not seem to exist anymore. I had installed it and found "widget.use-xdg-desktop-portal.file-picker in current releases where you can set an integer. Have a look at KDE Integration on ArchWiki. For me, it always used the GTK-Dialog, independend of the environment variable.
You'll need a native installation anyway.
For brave you can try using flags (~/.config/chromium-flags.conf), but as Firefox this is a GTK-Browser too. Chromium itself does use the portal file dialog here without any flags. (starts /usr/bin/chomium %U)

You can check if the portal is "working":
Code: Select all
qdbus org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.DBus.Properties.Get org.freedesktop.portal.FileChooser version

which should print an integer. 3 in my case.
dzon
Registered Member
Posts
493
Karma
3
The integer you need to set in firefox, if you want the qt file download dialog that is, needs to be set to 1 https://imgur.com/a/dhNnWGg. There's another method by adding a line to /etc/environment but the about:config setting is easier. As for brave using the gtk, I'd (re)install kdialog first. It's not good practice to mess with flags in the config file ( use chrome://flags instead) and besides, there aren't any flags for that issue. At least, not that I'm aware of.
As a sidenote. The firefox snap version has a bunch of issues. If you should want to enhance it ( harden or whatever..) I strongly suggest using a regular firefox.


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
dzon wrote:The integer you need to set in firefox, if you want the qt file download dialog that is, needs to be set to 1 https://imgur.com/a/dhNnWGg. There's another method by adding a line to /etc/environment but the about:config setting is easier. As for brave using the gtk, I'd (re)install kdialog first. It's not good practice to mess with flags in the config file ( use chrome://flags instead) and besides, there aren't any flags for that issue. At least, not that I'm aware of.
As a sidenote. The firefox snap version has a bunch of issues. If you should want to enhance it ( harden or whatever..) I strongly suggest using a regular firefox.


And once again the community comes through!! This again is why I love Linux and love open source!! Reinstalling kdialog was exactly what was needed! It instantly fixed both Firefox and Brave!! That terrible, buggy white dialog box is gone and this one is back! You cannot imagine how happy I am! Thank you SO much!!

Image
dzon
Registered Member
Posts
493
Karma
3
Ah, good. Also "good" to see this WAS a plasma/kde related issue and it WAS a kde community topic. O well, it's solved.


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
User avatar
TitaniumCoder477
Registered Member
Posts
9
Karma
0
Hey guys, so bad news and good news. The symptom came back! Not sure how or why, but it came right back. However, I was able to build on what we had already discovered and do the following:

sudo apt reinstall kdg-desktop-portal-kde
sudo apt reinstall kdialog
sudo apt reinstall kdg-desktop-portal
log off and back on

After doing this, it worked fine. The resolution seems to per persistent beyond multiple log offs and restarts.

As a side note--if you uninstall xdg-desktop-portal-gtk, you don't get the gtk OR the kde box! Super odd, but oh well.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]