GNOME Bugzilla – Bug 557689
In 'select folder' action, filechooser doesn't work when you first create the window
Last modified: 2010-08-11 18:55:34 UTC
Run 'testfilechooser -a select_folder' Click 'Open' button Confirm that it doesn't select the current folder In order to get it to open the current folder, you have to go to the previous directory and then go back to the original directory by clicking the item in the listview (not the buttonbar at the top).
Created attachment 121233 [details] [review] Proposed fix This appears to fix it for me, but I'm not very familiar with filechooser code in gtk+ yet so I'm not sure if this is the correct fix and would appreciate a review.
I cannot cofirm this, tried with 2.14.4 and trunk. The only thing that I notice is that unless I use arrow keys to move the current item in the tree view, there is no visible selection, but that would seem to be a different issue.
I'm still able to reproduce this in trunk.
(In reply to comment #3) > I'm still able to reproduce this in trunk. I can reproduce it reliably with trunk now. Clicking 'Open' does nothing whatsoever unless I manually select a folder. Not sure why it worked for me the last time. And the patch fixes it for me.
I think the patch fixes a symptom. What is the purpose of the response_requested flag in GtkFileChooserDialog? Alternatively, what if you turn on the response_requested flag before calling gtk_widget_activate() in gtkfilechooserdialog.c:file_chooser_widget_file_activated()?
Sorry I'm just now testing this. But no, that did not appear to fix the problem.
Actually, it seems to never call file_chooser_widget_file_activated() when I hit the "Okay" button after the dialog is created.
Same bug as bug 587039?
*** Bug 587039 has been marked as a duplicate of this bug. ***
Created attachment 148241 [details] [review] Possible Fix The problem actually occurs because of what widget has focus before you hit 'open'. If the entry has focus and is empty, the chooser doesn't work correctly. If the filelist has focus first, then it will work fine. This seems to fix the problem but I have not tested it very much.
This issue only seems to occur when the location text entry box is visible. If it is hidden (Ctrl+L), then one is able to open the current folder upon creation. This may be related to what Brett said about the entry having focus and refusing to close the dialog if it is focused and empty. Is there a way to programmatically hide the location entry?
Created attachment 155696 [details] [review] Another stab at a patch Federico, could you take a peek at this one? I think this makes more sense than my previous patch.
Created attachment 157773 [details] [review] Fix a problem if the action is GTK_FILE_CHOOSER_ACTION_SAVE
Just wanted to mention that this may be a dupe of bug 402349, who has 2 patches there as well waiting for review. However, one of the patches of that bug focuses on the problem when impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, but one of the patches here GTK_FILE_CHOOSER_ACTION_SAVE; so that may be a clue of why they are not exactly duplicates? Hence I won't mark them as such yet. Thoughs?
Review of attachment 157773 [details] [review]: Excellent, this makes a lot of sense. Please go ahead and push! Would this be needed in the case of CREATE_FOLDER as well?
*** Bug 582616 has been marked as a duplicate of this bug. ***