After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682047 - GtkFileChooser folder selection unpredictable behaviour
GtkFileChooser folder selection unpredictable behaviour
Status: RESOLVED DUPLICATE of bug 672271
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2012-08-16 22:12 UTC by Alexey Yakovenko
Modified: 2013-06-24 03:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexey Yakovenko 2012-08-16 22:12:02 UTC
all the related bugs that i can find are from 2005-2006, so i decided to make a new one.

i have the file path: /home/username/c/d

the folder "c" has several files and a single folder "d"

in the filechooser i doubleclick the folder "c", with the intention of adding it recursively, including the files in "c" folder, as well as "d" folder, but instead the folder "d" is automatically selected (in GTK2 the "c" folder is selected, and it IS the expected behaviour).

it should be fairly simple to reproduce in any application which has folder selection, i've used deadbeef player (file -> add folders) and transmission-gtk ("set location" context menu).

in transmission-gtk, it looks like the bug is multiplied by some transmission-specific weirdness, which makes it _really_ hard to select a specific folder.

if this behaviour is not a bug -- please let me know at least how to fix it locally in my own application. i'm using pretty much the same code for gtk2 and gtk3, and the filechooser works fine in gtk2 builds.
Comment 1 André Klapper 2012-08-17 10:02:36 UTC
I don't get it. The problem is that the first entry (d folder) is preselected as the first entry in the c folder? If so, that's by purpose. Don't know what you mean by "adding it recurisvely including the files in the c folder" though - does not sound like stuff to do in a file chooser but rather in the file manager if you want to copy/move files and folders around.
Comment 2 André Klapper 2012-08-17 10:03:35 UTC
An ordered list of steps might be helpful, plus expected and actual results.
Comment 3 Alexey Yakovenko 2012-08-17 10:28:09 UTC
hi André

you got it right -- the "d" folder is preselected, while the intention is to have the GTK2 behavior, where it's not preselected. can you give me some pointers where this behavior is documented, and how to fix it? i'd like to know what are my options before i start to look for an alternate file chooser, or writing my own.

by "adding it recurisvely" i mean that a user can press File -> Add Folders from menu, select a folder, which then will be recursively scanned for music files, adding them to playlist. that's available in many music players.

another case is torrent client "transmission-gtk", in which you can Set download location using context menu. there you need to select a specific folder.

i don't understand how filemanager is related, and i don't see what is the purpose of this automatic-preselection of a folder, when all other filechoosers in the world (including the one from gtk2) do it differently. but anyway, is there any option to fix it? preferably on system-wide level. and thanks for the fast response.
Comment 4 André Klapper 2012-08-17 10:55:04 UTC
(In reply to comment #3)
> you got it right -- the "d" folder is preselected, while the intention is to
> have the GTK2 behavior, where it's not preselected.

Rather unlikely, as bug 158578 implies the current behavior has been in place since GTK+ 2.4, so I'm not sure that what you call "GTK+ 2 behavior" was the behavior in GTK+2. 
Current behavior is intended because it makes accessibility via keyboard way easier. => NOTABUG, but behaves as intended.

> can you give me some pointers where this behavior is documented

I don't think there is anything to document here, but maybe I misunderstand.

> by "adding it recurisvely" i mean that a user can press File -> Add Folders
> from menu, select a folder, which then will be recursively scanned for music
> files, adding them to playlist. that's available in many music players.

Okay, that's nothing in the codebase of the filechooser, but done by your music player application instead.
Comment 5 Alexey Yakovenko 2012-08-17 11:11:07 UTC
now it looks like you misunderstood the problem.

gtk2 and gtk3 filechoosers behave differently with identical code. 2 screenshots to demonstrate the problem.

gtk2: http://img502.imageshack.us/img502/7080/filechooserbuggtk2.png
gtk3: http://img94.imageshack.us/img94/6461/filechooserbuggtk3.png

as you can see, in the gtk3 filechooser, the folder "gtkchooser_folder_b" is selected (can be seen in the "Location" field, and after i press Open -- this one will be selected.

while in gtk2 filechooser, the gtkchooser_folder_a will be selected.

in both cases, i double-clicked the gtkchooser_folder_a once, and didn't select the gtkchooser_folder_b.
Comment 6 André Klapper 2012-08-17 12:10:39 UTC
Yeah, I misunderstood. Sorry, reopening.

What is in the Location bar of the GTK+ 2 file chooser?
You can enbale it by pressing Ctrl+L.
Comment 7 Alexey Yakovenko 2012-08-17 15:01:37 UTC
the location bar in gtk2 is empty
Comment 8 Timothy Arceri 2013-06-01 12:50:18 UTC

*** This bug has been marked as a duplicate of bug 540788 ***
Comment 9 Alexey Yakovenko 2013-06-01 16:48:41 UTC
this bug doesn't have ANYTHING to do with the 540788.

this bug is about GTK3, while the GTK2 filechooser works correctly.

the other bug (540788) is about GTK2.12.
Comment 10 Timothy Arceri 2013-06-01 23:02:45 UTC
Aside from version numbers (which should be updated to a recent version anyway) the bug looks the same to me.
Comment 11 Alexey Yakovenko 2013-06-02 07:29:42 UTC
hi Tomothy.

in the comment #5 there are links to the 2 screenshots, which demonstrate, that gtk2 and gtk3 produce different results from the same sequence of user input. gtk2 gives the "expected" (i.e. correct for my expectations) result, while gtk3 gives the wrong result.

that's one thing. another thing is that this bug is about FOLDER OPEN dialog, and it is explicitly about selecting folders, while the other bug is about FILE SAVE dialog.

also, in this bug, there's no "sometimes" - the bug happens every time, and reproduction steps are concrete. with example files and screenshots.

and i'll say it again, this bug happens ONLY in GTK3, it didn't and doesn't happen in GTK2.

the bugs look a little similar, but they are about different things.
Comment 12 Timothy Arceri 2013-06-02 09:36:12 UTC
I still think both these are cause by the same thing. But dont have time to look into it further so unmarking duplicate for now.
Comment 13 Timothy Arceri 2013-06-24 03:56:55 UTC

*** This bug has been marked as a duplicate of bug 672271 ***