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 447984 - "idle activate multiple times without clearing the folder object first." message
"idle activate multiple times without clearing the folder object first." message
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.10.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2007-06-15 19:00 UTC by Phil Dumont
Modified: 2018-02-10 03:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.01 KB, patch)
2007-06-15 19:01 UTC, Phil Dumont
none Details | Review

Description Phil Dumont 2007-06-15 19:00:18 UTC
Prevent this message from happening.

Other information:
The message in the summary pops up occasionally.

It's rare, but I've found I can reproduce it roughly 1 in 10 times (your mileage will probably vary) by double-clicking on a directory in the bookmark pane, followed immediately by pressing '/' on the keyboard (on linux -- I guess on Windows you'd have to press '\').

It's in the source file gtkfilechooserentry.c.  gtk_file_chooser_entry_maybe_update_directory() seems to be trying very hard to prevent it from happening.  If it finds current_folder set, it unsets it.  If it finds a load_directory_idle pending, it does not do another one.

But it still happens sometimes.  I think the sequence of events is as follows:

 - gtk_file_chooser_entry_maybe_update_directory() sets a load_directory_idle.

 - idle calls load_directory_callback(), which unsets load_directory_idle.
   It then calls gtk_file_system_get_folder(), which sets up an idle for
   load_directory_get_folder_callback().

 - Before the idle load_directory_get_folder_callback() runs, an event happens
   that causes gtk_file_chooser_entry_maybe_update_directory() to run again.
   Since load_directory_idle has been unset (see previous bullet), it sets
   up another load_directory_callback().
   gtk_file_chooser_entry_maybe_update_directory() had unset current_folder,
   but...

 - ...there's still a load_directory_get_folder_callback() idle pending.  It
   runs first, and sets current_folder()...

 - ...then the load_directory_callback() runs, and it complains about
   current_folder being set.

I think a reasonable solution is for load_directory_callback() *not* to unset load_directory_idle (unless is skips the setting up of the load_directory_get_folder_callback()), and for load_directory_get_folder_callback() to unset load_directory_idle instead.

Note that I have not throughly studied the code, so I don't *know* that this is safe.  But I have implemented it, the warning seems to have gone away (have not been able to reproduce it after several minutes of steady trying), and have not seen any other adverse effects.  Will attach patch.
Comment 1 Phil Dumont 2007-06-15 19:01:18 UTC
Created attachment 90030 [details] [review]
proposed patch
Comment 2 Matthias Clasen 2018-02-10 03:23:24 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.