Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In Ubuntu and Kubuntu 11.10 I see changes in behaviour of GTK file chooser dialog. When I try to open new file (second, third etc, not first in editor) dialog show "Recenty used" section. It is very unsuitable for me, in 10.04 dialog shows folder where located previous open file. Anybody knows how i can bring back old behaviour?

share|improve this question
4  
While I haven't tested to see exactly what happens, this can almost certainly be attributed to 11.10 using GTK3 instead of GTK2. I suggest you file this as a bug if you think this isn't how it should behave. –  Oli Sep 27 '11 at 14:22
    
in some case it is ok, but i hoped can change it in some config –  Dim_K Sep 28 '11 at 9:22
3  
This is really annoying feature! I have tried playing with ~/.config/gtk-2.0/gtkfilechooser.ini but with no success so far –  Tzury Bar Yochay Oct 16 '11 at 4:27
1  
Before this, 11.10 had been defaulting to "File System" namely "/" and if I'm not mistaken prior releases defaulted to "Home." Being able to configure a default would work well for me since I do most of my work in a "work in progress" folder. –  fragos Oct 26 '11 at 22:55
2  
Are there any active Launchpad bugs for this? I'd like to follow them and lend my support for a sane default and/or customisability. –  weberc2 May 29 '12 at 15:58

5 Answers 5

To my knowledge, this is a "feature" of GTK+ 3.x, and I'm not so certain it can be changed.

If I find a solution I will update my answer, but for now I don't know of any (other than reporting a bug).

Update:

I believe I may have found a partial solution. It's not a permanent one unfortunately.

  1. Install dconf-tools.
  2. Run dconf-editor.
  3. Navigate to org.gtk.settings.file-chooser.
  4. Change the last-folder-uri value to the folder of your choosing, for example file:///home/rolandixor/Desktop.
  5. Your file chooser dialogues should now use this folder by default. However, they will revert to recently used if you use the dialogue but do not actually open/save a file.

Update2:

As this is rather tricky, here is another possible solution (partial):

  1. Open gedit.
  2. Open a file (from the folder you want to use).
  3. Save a file (save as) to the folder you want to use.
  4. Close gedit. This will only work if you actually open a file from a folder and save to a folder. If you open the dialogue and don't do anything, it will revert when you close it. There is no way around this.
share|improve this answer
    
Okay, I was afraid of that. I'll wait a few days to see if anyone has a clever solution, but otherwise I'll give you the bounty. –  Kris Harper Oct 26 '11 at 23:45
    
@root45: I'm going to do some searching on the issue and update my answer. –  RolandiXor Oct 26 '11 at 23:51
    
@root45: Check my update now :). –  RolandiXor Oct 27 '11 at 0:08
1  
Hmm, doesn't seem to work for me. I still get the Recently Used folder. –  Kris Harper Oct 27 '11 at 0:36
    
@root45: it works for me in gedit - but as I said, it's a partial solution. I'll update my answer with another possibility. –  RolandiXor Oct 27 '11 at 0:40

I was also bugged by this behaviour and gave it a closer look during the last days.

I have found only one of the GTK3 applications so far that always brings up Recently Used at fresh start: Gedit. All other apps I have tested (Totem, Eog, Evince, File-Roller, ...) start with a "normal" folder in their file chooser (tested with fresh guest session).

So I did a small patch that makes Gedit fall back on the Home folder instead of Recently Used: http://pastebin.com/GhXCRzNV

I can also provide a debdiff if requested, or create a PPA.

share|improve this answer
    
Geany also exhibits this annoying behaviour. How can we apply your patch, please? And would your patch solve the problem for other apps or just Gedit? I'm not a programmer but I might be able to follow instructions - as long as they're simple enough for someone as dense as me ;-) –  dunderhead Feb 13 '12 at 15:24

Maybe it would be easier to patch gtk3 to populate the recently used files with the folder the last file was in as well. I think that would work nicely for me.

share|improve this answer

Also you could use shortcut for revealing Location input box and going to desired directory: ~ (tilde sign), Shift-` on some keyboards.

share|improve this answer

For GTK2 you want to edit $XDG_CONFIG_HOME/gtk-2.0/gtkfilechooser.ini and set

StartupMode=cwd

For GTK3 there is no way to change it. In older versions this command might work

gsettings set org.gtk.SettingsFileChooser startup-mode cwd
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.