GNOME Bugzilla – Bug 623343
Selection stops working in GtkFileChooser
Last modified: 2010-10-14 11:45:31 UTC
Steps to Reproduce: 1) Open directory with a few files in GtkFileChooser. 2) Select one file in this directory with GtkFileChooser. 3) Change one of other files in this directory (for example, change text file in vim or create new file with 'touch'). 4) Now, selection change is impossible. Interface is not freezed, i can, for example, change directory and come back and everything will work again. It reproduces on a few machines with Ubuntu 10.04. With GNOME and IcewWM, with different gtk themes. But it doesn't reproduces with Ubuntu 8.04 (old GtkFileChooser doesn't update info about files in a directory). OS and gtk info: $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS" $ dpkg-query -W libgtk2.0-0 libgtk2.0-0 2.20.1-0ubuntu2 PS. Sorry for my English, i'm not a native speaker.
It reproduces with such small example (sorry, I can't attach files at work because of proxy restrictions): #include <gtk/gtk.h> static void file_chooser_cb(GtkWidget *widget, gpointer data) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new("Open File", GTK_WINDOW(gtk_widget_get_parent(widget)), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char *filename = NULL; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); printf(">> %s\n", filename); g_free(filename); } gtk_widget_destroy(dialog); } int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); button = gtk_button_new_with_label("Open FileChooser"); g_signal_connect(button, "clicked", G_CALLBACK(file_chooser_cb), NULL); gtk_container_add(GTK_CONTAINER(window), button); gtk_widget_show_all(window); gtk_main(); return 0; }
The problem reproduces with the last PCLinuxOS LiveCD (pclinuxos-ZEN-mini-2010.1.iso). So, it's not a distribution peculiarity.
Confirmed.
OK, this got fixed in GTK+ 2.22 as part of bug #621414. You want the patch from commit 42abeadbb812172c8f3e3c7b7dc4662cb90cff89. I'll attach it. *** This bug has been marked as a duplicate of bug 621414 ***
Created attachment 172213 [details] [review] gtk2-bgo623343-cant-select-file.diff
Thank you! I've tried Ubuntu 10.10 with my example, it works great without any freezes.