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 355623 - gtk_file_chooser_button emits "selection-changed" signal on CANCEL from dialog
gtk_file_chooser_button emits "selection-changed" signal on CANCEL from dialog
Status: RESOLVED DUPLICATE of bug 691040
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
filechooser-retest
Depends on:
Blocks:
 
 
Reported: 2006-09-12 18:06 UTC by Peter Clifton
Modified: 2013-09-23 20:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16



Description Peter Clifton 2006-09-12 18:06:35 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
  • #0 dialog_selection_changed_cb
    at gtkfilechooserbutton.c line 2410
  • #1 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #2 IA__g_closure_invoke
    at gclosure.c line 490
  • #3 signal_emit_unlocked_R
    at gsignal.c line 2438
  • #4 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #5 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #6 delegate_selection_changed
    at gtkfilechooserutils.c line 330
  • #7 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #8 IA__g_closure_invoke
    at gclosure.c line 490
  • #9 signal_emit_unlocked_R
    at gsignal.c line 2438
  • #10 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #11 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #12 delegate_selection_changed
    at gtkfilechooserutils.c line 330
  • #13 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #14 IA__g_closure_invoke
    at gclosure.c line 490
  • #15 signal_emit_unlocked_R
    at gsignal.c line 2438
  • #16 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #17 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #18 list_selection_changed
    at gtkfilechooserdefault.c line 8190
  • #19 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #20 IA__g_closure_invoke
    at gclosure.c line 490
  • #21 signal_emit_unlocked_R
    at gsignal.c line 2438
  • #22 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #23 IA__g_signal_emit
    at gsignal.c line 2241
  • #24 _gtk_tree_selection_internal_select_node
    at gtktreeselection.c line 1409
  • #25 IA__gtk_tree_selection_select_path
    at gtktreeselection.c line 742
  • #26 IA__gtk_tree_selection_select_iter
    at gtktreeselection.c line 810
  • #27 select_func
    at gtkfilechooserdefault.c line 6368
  • #28 _gtk_file_system_model_path_do
    at gtkfilesystemmodel.c line 1206
  • #29 show_and_select_paths_finished_loading
    at gtkfilechooserdefault.c line 5784
  • #30 get_folder_cached_callback
    from /usr/lib/gtk-2.0/2.10.0/filesystems/libgnome-vfs.so
  • #31 execute_vfs_callbacks_idle
    from /usr/lib/gtk-2.0/2.10.0/filesystems/libgnome-vfs.so
  • #32 g_idle_dispatch
    at gmain.c line 3926
  • #33 g_main_dispatch
    at gmain.c line 2045
  • #34 g_main_context_iterate
    at gmain.c line 2596
  • #35 IA__g_main_loop_run
    at gmain.c line 2881
  • #36 IA__gtk_dialog_run
    at gtkdialog.c line 996
  • #37 _wrap_gtk_dialog_run
    from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
  • #38 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #39 ??

Comment 1 Peter Clifton 2006-09-12 18:38:18 UTC
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

Comment 2 Federico Mena Quintero 2013-09-23 20:55:04 UTC

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