JetBrains: Hide popover instead of recreating the browser on Mac OS
Created by: philipp-spiess
Closes #34773 (closed)
This is another attempt to work around #34694 (closed). This time, we do not sacrifice performance.
Instead of recreating the JCEF browser whenever the popup is shown, we instead use a feature on the popup to hide it. This means that the popup will not dispose and we can easily show it again later.
Instead of the previous workaround in #35779, this increases the resource usage slightly as we keep the popup in memory. However since we already keep the JCEF window in memory anyway, I do not think this is a large overhead.
Note: Adding the manual cancellation callback prevented the events to fire properly when the escape key is pressed. To work around this, I've added manual event listeners for the escape key in this scenario.
I also verified that this works with multiple projects open at once (as you can see in the test plan).
Test plan
https://user-images.githubusercontent.com/458591/169521284-80e8df59-7087-451a-9605-d79343bb97ef.mov
App preview:
Check out the client app preview documentation to learn more.