Wait on shutdown for docks to close on Linux (Event-based solution) #460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Solution 1 was a no-go with the Qt event loop, which we'd prefer to use.
This is solution two, which listens for an event from CEF when the shutdown is occurring. At most, it's configured to wait 1 second per dock (this is usually more than enough time, but we could bump it to 2 or 3 if needed).
This also moves widget destruction to after Qt destruction, otherwise CEF can't notify Qt that it's ready to close.
Also Closes #459
Motivation and Context
The original solution in #450 works fine when not using the Qt event loop, however any method of waiting with the Qt event loop causes all CEF events to go on hold too, resulting in a hang or crash.
How Has This Been Tested?
On Linux, with two browser docks: YouTube and Google. The former is considered a "heavier" dock and takes longer to close.
Also successfully loaded the Twitch OAuth window.
Tested with our current Beta 1-shipping CEF build of 127.
With this PR, there is no crash or hang on shutdown.
Note: Have not tested "What's New" myself.
Types of changes
Checklist: