You are not logged in.
Each time I save or open a document, the dialog box defaults to "Recently Used". What I'm wanting to find out is how to get rid of the entry from the "Places" bar altogether. I understand that the entry was put there with good intentions, but it seems to always amount to an extra step. The best example is when I use "Save As". I will type the name of the file and since the dialog has automatically put me under "Recently Used", I have to then navigate to where I want to save or the "Please select a folder below" error will appear. Had the dialog defaulted to the home folder, this stumbling block could be eliminated.
I realize there is probably some fundamental knowledge I'm not aware of and don't know exactly what to search for. I'm using Openbox and have the core XFCE applications installed, but I don't know if this is a GTK issue, xdg, or what. All of my searches point to getting rid of ~/.local/share/recently-used.xbel, but I'm not concerned with that and already have a transparent panel launcher that handles it.
I have found a post in this forum that addresses the same issue, but it has gone unresolved also:
https://bbs.archlinux.org/viewtopic.php?id=129555
This user mentions a directory hack that is resolving the issue for now, barring any other solution, I'd like to know exactly what that is, as I can't seem to find the answer to that either.
Thanks in advance for any help.
Last edited by freud_zoid (2011-12-14 19:33:07)
Offline
It seems your google-fu is much weaker than mine . When I first noticed this behavior some time back, and it was totally driving me nuts, I quite quickly found the cause of it, the commit that did it, and some discussions justifying the change. It's a deliberate change in GTK. And like I said, it was driving me nuts too. So I came up with this:
diff -Nur gtk/gtkfilechooserdefault.c.orig gtk/gtkfilechooserdefault.c
--- gtk/gtkfilechooserdefault.c.orig 2011-10-01 17:29:06.000000000 +0200
+++ gtk/gtkfilechooserdefault.c 2011-10-28 23:53:19.849781029 +0200
@@ -5972,7 +5972,7 @@
switch (impl->reload_state)
{
case RELOAD_EMPTY:
- recent_shortcut_handler (impl);
+ home_folder_handler (impl);
break;
case RELOAD_HAS_FOLDER:
It makes the file chooser default to the home dir instead of recently used. You'll have to recompile GTK with this patch applied.
Offline
Thank you immensely!
I've only been using Arch (and Linux in general) for a few months and this was the single issue I couldn't get resolved. What you've done for me today has not only fixed my problem, but helped me learn a couple other things besides...they say Arch is good for that. This exercise alone was worth it just to get acquainted with ABS.
On the other hand, I am a bit ashamed of my yellow belt in Google-Fu.
Last edited by freud_zoid (2011-12-14 19:34:04)
Offline
I would like to patch this too (i've never patched anything before btw) but the ABS source here doesn't have 'gtk/gtkfilechooserdefault.c'. The nearest match is 'gtk/gtkfilesel.c'. This is from 'gtk+-1.2.10.tar.gz'.
And presumably I'd need this line in the PKGBUILD?
patch -Np0 -i "${srcdir}/patchname"
Any pointers greatly appreciated, thanks.
Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64
Offline
What you want is gtk2, not gtk
Offline
Many thanks Gusar Patched, built and installed.
Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64
Offline
In the recent update to gtk2-2.24.14-1 the code in gtkfilechooserdefault.c has changed and the patch no longer works. Gusar, is it possible to provide a new patch please? I absolutely hate the default behaviour.
Offline
There had been a report for necrobumping. This is a bit old, but it seems like it is still relevant. I am leaving this alone.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Online
In the recent update to gtk2-2.24.14-1 the code in gtkfilechooserdefault.c has changed and the patch no longer works. Gusar, is it possible to provide a new patch please? I absolutely hate the default behaviour.
I haven't made many patches for things and you'll need to type in the file name when you apply it, but this will work for the current gtk2 package:
--- gtkfilechooserdefault.c.orig 2012-12-06 20:24:05.758831989 -0500
+++ gtkfilechooserdefault.c 2012-12-06 20:28:07.352183658 -0500
@@ -6061,7 +6061,7 @@
switch (impl->startup_mode)
{
case STARTUP_MODE_RECENT:
- recent_shortcut_handler (impl);
+ home_folder_handler (impl);
break;
case STARTUP_MODE_CWD:
Or if you'd rather, you can just edit gtkfilechooserdefault.c directly and replace 'recent_shortcut_handler' on line 6064 with 'home_folder_handler' and rebuild.
The patch above probably reveals my lack of expertise, but thanks goes again to Gusar for showing the way.
Offline
@freud_zoid: Patches are usually made from the top-level source dir (so they apply with -p0), or a level above that (in which case they apply with -p1). But your version can still be applied cleanly, just tell patch which directory the file is in with -d:
patch -Np0 -d gtk -i "${srcdir}/patchname"
Offline
Many thanks freud_zoid for the patch, and to Gusar for the original and teaching me something about patch just now. Patched and working
Offline