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 623343 - Selection stops working in GtkFileChooser
Selection stops working in GtkFileChooser
Status: RESOLVED DUPLICATE of bug 621414
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.20.x
Other Linux
: High major
: Need diagnosis
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2010-07-02 07:44 UTC by ya.dam.vam.parabellum
Modified: 2010-10-14 11:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk2-bgo623343-cant-select-file.diff (812 bytes, patch)
2010-10-12 20:15 UTC, Federico Mena Quintero
committed Details | Review

Description ya.dam.vam.parabellum 2010-07-02 07:44: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.
Comment 1 ya.dam.vam.parabellum 2010-07-02 07:48:52 UTC
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;
}
Comment 2 ya.dam.vam.parabellum 2010-07-05 06:05:41 UTC
The problem reproduces with the last PCLinuxOS LiveCD (pclinuxos-ZEN-mini-2010.1.iso).
So, it's not a distribution peculiarity.
Comment 3 Federico Mena Quintero 2010-10-12 19:16:44 UTC
Confirmed.
Comment 4 Federico Mena Quintero 2010-10-12 20:13:43 UTC
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 ***
Comment 5 Federico Mena Quintero 2010-10-12 20:15:51 UTC
Created attachment 172213 [details] [review]
gtk2-bgo623343-cant-select-file.diff
Comment 6 ya.dam.vam.parabellum 2010-10-14 11:45:31 UTC
Thank you!
I've tried Ubuntu 10.10 with my example,
it works great without any freezes.