Enable to open multiple file-pickers in Chromium for Linux
Sometimes we don't know the exact requirements or anticipate user behavior while developing or fixing something. I fixed the file-picker modal issue in Chromium for Linux last year. At that time, the reviewer and I thought there would be no case where multiple file-pickers pop up, but it happened since M55 when you follow these steps:
- Enable "Ask where to save" in settings.
- Open 2 tabs of, e.g., https://sourceforge.net/projects/azureus/files/latest/download
- Wait for 2 downloader windows, then close/cancel both.
- Freeze or crash.
Here is a video to reproduce the problem.
When a file-picker is opened, it disables event listening on the main host window. When the user closes the file-picker, event listening is enabled again. Now the host window has a counter to track the number of open file-pickers, and it does not disable event listening as long as any file-picker is open. Event listening is only re-enabled when the last file-picker is closed. Here is the fix.
Anyway, you may see the fix in M58 (Apr 25th, 2017).