topkoa 0cde745f03 fix(panes): let toggleWindow be the authority, not a stale hasWindow() check
The tray menu asked "do we own a window for this pane?" and then acted on the
answer. Windows are destroyed asynchronously, so between the question and the
act the answer can go stale: hasWindow() says yes, the window is destroyed,
toggleWindow() returns false, the handler has already committed to the
main-process path and returns — and the click lands on nothing.

A tray item that silently does nothing is the worst possible failure here,
because the tray IS the recovery path when a pane is out of sight.

toggleWindow() already reports whether it did anything. Use that: if it toggled,
we're done; if it didn't, we never had that window (or just lost it), and only
the renderer can decide what opening the pane means — it might belong in the
dock, and its element lives there.

hasWindow()/hasPaneWindow() existed only to support the racy check, so they're
gone rather than left lying around for someone to reintroduce the race with.

Signed-off-by: topkoa <topkoa@gmail.com>
2026-07-12 21:30:38 -04:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
2026-06-16 18:48:12 +02:00
S
Description
No description provided
AGPL-3.0
2.8 MiB
Languages
C++ 52%
TypeScript 18.6%
JavaScript 17.9%
Shell 7.3%
CMake 2.4%
Other 1.8%