I have analyzed and solved the problem I was seeing. Let's look at gtk+2.0-2.12.9/gtk/gtkfilesystemmodel.c. In the callback function got_root_folder_cb, there is this code:
if (gtk_file_folder_is_finished_loading (model->root_folder)) g_signal_emit (model, file_system_model_signals[FINISHED_LOADING], 0); else g_signal_connect_object (model->root_folder, "finished-loading", G_CALLBACK (root_folder_finished_loading_cb), model, 0); Basically, this means: if the folder is already loaded, tell the dialog we're done, otherwise wait for the folder to load (and then tell the dialog). The function then goes on to populate the model with the files in the folder: gtk_file_folder_list_children (model->root_folder, &roots, NULL); ... for (tmp_list = roots; tmp_list; tmp_list = tmp_list->next) { ... } This is where things go wrong; it seems that this loop isn't necessary at all. The model is already populated in do_files_added. If the folder hasn't been loaded yet, this doesn't even do anything because gtk_file_folder_list_children will return an empty list. But if the folder IS already loaded, then this loop will add all files a second time! However, there is another question: Why does the above call to gtk_file_folder_is_finished_loading only return true on the second path bar click? In other words, why isn't the 'loaded' status reset before the second click? Well, there is some sort of caching going on, for a duration of FOLDER_CACHE_LIFETIME. And guess what, it's exactly 2 seconds. So, how do we solve the problem? Simply remove the superfluous loop mentioned above. Of course this might have nasty side effects, so someone who's familiar with gtk's internals should have a look at what's going on here. Now another issue crops up. The selection doesn't show up after the second click. Maybe someone else can figure that one out. ** Attachment added: "patch" http://launchpadlibrarian.net/16226113/patch -- Duplicate file entries after double-clicking path button in file dialog https://bugs.launchpad.net/bugs/239085 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs