You are not logged in.
Pages: 1
One of the most cringeworthy things in XFCE is saving files.
Saving something from Firefox, Audacity, Engrampa etc., I get a very inconvenient Gtk FileChooser window:
(1) When I select a folder from the location drop-down menu, it deletes the file name.
(2) When I click a path component above the currently selected folder, i.e. its parent folder, yes it goes to the parent folder, but the previously visited subfolder remains highlighted, so trying to "Save" I end up in that subfolder again. (And there is no way to un-highlight the subfolder; clicking blank areas doesn't help).
(3) When I want to filter files/folders in the selected folder, I click the file list area, and some file (probably just first one) gets selected (highlighted) in there, deleting (replacing) the original file name.
(4) And if I want to clear the filter, e.g. by clicking "clear entry" icon (or by pressing Backspaces), it doesn't go back to the "clean unfiltered" state. Either I have empty useless space (1) or file names that are still filtered (2):
(5) Often I can't get the location entry (e.g. when clicking "Extract" in Engrampa), there's only a sequence of path parts, so I can't just paste the desired path, I have to go through a long tedious navigation across folders.
I know all that ugliness is rather a GTK problem than XFCE, and there are already discussions about File Chooser, e.g. to replace it with Thunar dialog or something, which would be nice:
https://forum.xfce.org/viewtopic.php?id=14747
But still, is there yet any practical solution on how to improve this annoying situation, something that I can do today?
I'd really like to have more convenient UI, even if I had to write a few lines in Python or shell script.
Last edited by chang-zhao (2023-12-18 06:38:31)
Offline
Short of hacking Gtk and the GtkFileChooser dialog, I don't think you will be able to address any of your concerns directly. There does exist a hacked version of GTK3 called gtk3-classic that has some filechooser improvements (see link for list) that you can use as well.
As a potential alternative approach, there are some discussions about creating an xdg-desktop-portal-xfce interface. From https://wiki.archlinux.org/title/XDG_Desktop_Portal:
Portals were designed for use with applications sandboxed through Flatpak, but any application can use portals to provide uniform access to features independent of desktops and toolkits.
One of the features of using a "foreign" desktop portal, is that you can use another file chooser (for example KDE/Dolphin) in place of GtkFileChooser - not just for flatpack apps, but for all apps. This is done by tricking all apps to believe they are running sandboxed.
Test on Arch:
Install xdg-desktop-portal-kde (note: this will bring in many KDE dependencies
edit the file /usr/share/xdg-desktop-portal/portals/kde.portal and change the last line to read:
UseIn=KDE;XFCE
To test, close your browser and restart it via:
GTK_USE_PORTAL=1 firefox
...and "Save As" something.
To make it permanent for all apps, add "GTK_USE_PORTAL=1" to one of your start up files (~/.pan_environment, ~/.xprofile, ~/.bashrc - whichever one works for your configuration).
You can follow the discussions and work at the first link above regarding an implementation of thunar as a potential GtkFileChooser replacement.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I try xdg-desktop-portal-kde, but at this step
...
[*]To test, close your browser and restart it via:GTK_USE_PORTAL=1 firefox
...and "Save As" something.[/*]
saving pages doesn't work. I get:
Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.FileChooser” on object at path /org/freedesktop/portal/desktop
???
Rebooting doesn't help.
Last edited by chang-zhao (2023-12-19 10:24:18)
Offline
I created '/usr/share/xdg-desktop-portal/portals.conf'
[preferred]
default=gtk
org.freedesktop.impl.portal.FileChooser=kde
and it works.
Offline
I have been trying to implement this portal thing but I can't seem to make any difference. Does anyone have a screen shot of the improved xdg-desktop-portal-kde dialogue? Not sure what I am looking for if it was successful.
I agree with chang-zhao the current dialogue is terrible.
Offline
I answer my own question
does look much better!
maybe there would be some way to implement this that was easier to access.for users who do not find the very specific information required to make the change this way. The existing dialogue has other substantial issues not even mentioned in the OP.
I see there are several other backends
GTK xdg-desktop-portal-gtk
GNOME xdg-desktop-portal-gnome
KDE xdg-desktop-portal-kde
LXQt xdg-desktop-portal-lxqt
Pantheon (elementary OS) xdg-desktop-portal-pantheon
wlroots xdg-desktop-portal-wlr
Deepin xdg-desktop-portal-dde
Xapp (Cinnamon, MATE, Xfce) xdg-desktop-portal-xapp
https://flatpak.github.io/xdg-desktop-portal/
are they all interchangeable?
Offline
For Firefox it works, and we can even transfer folders' bookmarks between GTK and KDE software:
https://github.com/jlu5/bookmarksync
But unfortunately many programs in XFCE, such as Engrampa Archive Manager, still use native GTK file chooser, so the solution with alternative "portals" doesn't help that much.
Are they all interchangeable?
Probably (though I don't know what is the difference between xdg-desktop-portal-gtk and xdg-desktop-portal-gnome).
The existing dialogue has other substantial issues not even mentioned in the OP.
It would be nice to collect all the problems with it and post an issue or something, as a document for discussions and improvements. Or does it already exist?
Offline
I did some looking around and I think the appropriate issue tracker might be xfce4-session.
There is currently 1 issue (closed) regarding this that I found: Please provide an xfce-portals.conf for xdg-desktop-portal >= 1.17. It is a bit over my head but I might try to read it later on.
In this 2022 forum post, ToZ said replacing the filechooser would be best suggested at libxfce4ui tracker. I can't find anything there mentioning the subject so maybe it would be worthwhile if nobody has at least raise the various problems.
I am not sure whether it would be best/plausible-est to ask for though?
a) fix the various problems in the current file chooser
b) switch to another already-existing option
c) provide better methods for users to switch based on their preferences (e.g. adding some sort of GUI to ToZ's method above)
d) at least documenting the possibility of manual configuration as above
e) something else?
I would be interested to know what the feelings of the devs are regarding the existing implementation. Do they not find it aggravating to use? I find it causes so much unexpected behavior; I do not know how this is ignored by anyone. Maybe in there is something relevant to be found in the old bugzilla tracker.
Offline
See also https://gitlab.xfce.org/xfce/xfce4-session/-/issues/159 and linked issues there.
Offline
WARNING
xdg-desktop-portal-kde installs spyware
https://forum.xfce.org/viewtopic.php?id=17327
Offline
Pages: 1
[ Generated in 0.014 seconds, 9 queries executed - Memory usage: 588.55 KiB (Peak: 605.4 KiB) ]