Skip to content

Fix: closing the window does nothing on 2.1.0 - #88

Merged
broisnischal merged 1 commit into
masterfrom
hotfix/window-close
Sep 25, 2026
Merged

broisnischal merged 1 commit into
masterfrom
hotfix/window-close

Conversation

@broisnischal

Copy link
Copy Markdown
Collaborator

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.json granted core:window:allow-close but never core:window:allow-destroy.

The gap has been in the file for a while, but it was unreachable: the tray build intercepted CloseRequested and hid the window, 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 rejected promise went nowhere.

Caught live in a dev run:

[vite] (client) [Unhandled rejection] Unknown Error: window.destroy not allowed.
Permissions associated with this command: core:window:allow-destroy

The capability also scoped to "windows": ["main"] only, 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 title bar.

Fix

  • Add core:window:allow-destroy.
  • Widen the capability to ["main", "main-*"] so second windows get the same window chrome permissions.
  • WindowControls.svelte awaits 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:

before after
window.destroy not allowed per run 9+ 0
app process after close survives (needed kill -9) exits cleanly
npm run tauri dev exit code killed 0
Stroke windows left 1 0

Driven through closeWindow() itself on a fresh boot, so it exercises the same path as the title bar X.

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.
@broisnischal broisnischal added the release:patch Bump patch version (0.0.x) label Sep 25, 2026
@broisnischal
broisnischal merged commit 44d99e5 into master Sep 25, 2026
1 check passed
@broisnischal
broisnischal deleted the hotfix/window-close branch September 25, 2026 04:32
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release:patch Bump patch version (0.0.x)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant