GNOME Bugzilla – Bug 355623
gtk_file_chooser_button emits "selection-changed" signal on CANCEL from dialog
Last modified: 2013-09-23 20:55:04 UTC
Please describe the problem: (Discovered with the pygtk bindings, so not sure if this is a GTK bug or not...) When working with the gtk file chooser button, once the button has a filename already selected, clicking the button (to open the default file-chooser associated with the button), and then clicking "Cancel" on the file-chooser, somewhere a "selection-changed" signl gets emitted which makes it back to the calling program. There is not obvious mechanism to determine at this point whether the user had accepted or cancelled the dialog box, so code to automate further steps based upon the user's closing of the file-dialog won't work correctly if the user cancelled the dialog box. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Backtrace, having hit "Cancel" on the file-chooser opened by clicking the file-chooser-button. Only appears to happen when the file-chooser-button had a filename already: Breakpoint 6, dialog_selection_changed_cb (dialog=0x825d8e0, user_data=0x824f1b0) at gtkfilechooserbutton.c:2410 2410 update_label_and_image (user_data); (gdb) bt
+ Trace 72199
Can be simply reproduced using "testfilechooserbutton" in the "tests" directory of the GTK source. Once a file-name is selected, re-opening the chooser and selecting "Cancel" results in a "selection-changed" event: """ ** Message: GtkFileChooserButton::selection-changed Selection:`file:///home/pcjc2/source/gtk+-2.10.3/tests/autotestfilechooser.c' Done. """ Peter
*** This bug has been marked as a duplicate of bug 691040 ***