fix: instant hide the window and proces in background - #95
Conversation
|
Related to #94 |
|
Thanks @Flash303 — your diagnosis was right, and I could confirm it in the code: I've opened #97, which takes your approach (hide first, let the sync finish in the background) plus two safety fixes:
It also adds unit tests for the handler, and I gated it on a real build under Xvfb/WebKitGTK with a test plugin whose quit hook runs ~2.4s: the window reports invisible from 303ms onward while the hook is still running, and the process exits 2.97s after the close — right after the hook, not on the fallback. With no hook registered, exit was ~240ms. I don't have a Windows machine to check against, so if you get a chance to build #97 (or try the next dev build) with gist-sync enabled and confirm the close feels instant on your side, that would be great. I'll most likely close this PR in favour of #97, but the fix is yours — credited there. |
This pull request introduces improvements to window management permissions and the quit handler behavior in the application. The main focus is on allowing the window to be hidden and ensuring the window is hidden before executing quit logic.
Window management enhancements:
core:window:allow-hidecapability to thedefault.jsonconfiguration, enabling the application to programmatically hide the window.Quit handler improvements:
ensureQuitHandlerfunction inruntime.tsto callwin.hide()when a close is requested, ensuring the window is hidden before running quit callbacks.