GtkFileChooserNative issues on win32 with slow/inaccessible network drives
Steps to reproduce
- Map a network drive
- Compile and run fc.c
- Disconnect from the network
- Navigate to a directory on the now-inaccessible network drive, the green loading indicator in the address bar should appear
- Quickly click "file chooser" int the test app and open a file
- Click the test button
Current behavior
The lowest label shows "open" for some seconds and clicking the "Test" button will set the label to "in filechooser".
The main recursive main loop started by gtk_native_dialog_run
keeps running for a while after the file chooser dialog is closed and happily processes events from the main window.
Once something has timed out due to the inaccessible network drive, the recursive main loop returns.
In https://github.com/horizon-eda/horizon/issues/637#issuecomment-1002342928, this caused a crash since the recursive main loop received the event to close the window it was running in. When the regular main loop resumed, it operated on a deleted window and crashed.
Expected outcome
The user shouldn't be able to interact with the parent of the native dialog until gtk_native_dialog_run
has returned.
Version information
Gtk 3.24.31 from MSYS2, Windows 10 20H2