Repository navigation
Fix: closing the window does nothing on 2.1.0 - #88
Merged
Merged
Conversation
Closing Stroke did nothing after 2.1.0. Clicking the title bar X left the window on screen and the process alive, and since that release ships no tray and no native decorations, there was no other way to quit the app. The capability file granted `core:window:allow-close` but never `core:window:allow-destroy`. That gap was invisible until now: the tray build intercepted CloseRequested and hid the window instead, so `close()` never ran through to `destroy`. Removing the tray in 3ea0c80 let it through for the first time, the ACL refused the call, and the rejection went nowhere: window.destroy not allowed. Permissions associated with this command: core:window:allow-destroy The capability also only covered the window labelled `main`, so every control on a second window (Ctrl/Cmd+Shift+N, labelled `main-2` onward) was denied the same way: close, minimize, maximize and dragging the bar. Widened to `main-*`. Window controls now await their core call and log a failure instead of discarding the promise, so the next gap in the capability file shows up somewhere rather than nowhere.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The bug
Closing Stroke does nothing on 2.1.0. Clicking the title bar X leaves the window on screen and the process alive. That release ships no tray icon and no native window decorations, so the X is the only close affordance there is, and the app cannot be quit from its own UI at all.
Cause
src-tauri/capabilities/default.jsongrantedcore:window:allow-closebut nevercore:window:allow-destroy.The gap has been in the file for a while, but it was unreachable: the tray build intercepted
CloseRequestedand hid the window, soclose()never ran through todestroy. Removing the tray in 3ea0c80 let it through for the first time, the ACL refused the call, and the rejected promise went nowhere.Caught live in a dev run:
The capability also scoped to
"windows": ["main"]only, so every control on a second window (Ctrl/Cmd+Shift+N, labelledmain-2onward) was denied the same way: close, minimize, maximize, and dragging the title bar.Fix
core:window:allow-destroy.["main", "main-*"]so second windows get the same window chrome permissions.WindowControls.svelteawaits its core call and logs a failure instead of discarding the promise, so the next gap in the capability file surfaces somewhere rather than nowhere.Verification
Reproduced and fixed against a dev build:
window.destroy not allowedper runkill -9)npm run tauri devexit codeDriven through
closeWindow()itself on a fresh boot, so it exercises the same path as the title bar X.