GNOME Bugzilla – Bug 447984
"idle activate multiple times without clearing the folder object first." message
Last modified: 2018-02-10 03:23:24 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.
Created attachment 90030 [details] [review] proposed patch
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.