Skip to content

fix(window): show launch logs for ephemeral windows and stop them getting stuck - #129

Merged
PapyElGringo merged 1 commit into
mainfrom
fix/ephemeral-window-launch-logs
Oct 13, 2026
Merged

PapyElGringo merged 1 commit into
mainfrom
fix/ephemeral-window-launch-logs

Conversation

@PapyElGringo

Copy link
Copy Markdown
Contributor

Summary

Fixes the stuck/blank ephemeral window from #128.

An EphemeralWindow that never receives a MetaWindow keeps metaWindowId == null. Its close button called WindowProviderMixin.closeWindow(), which only closes owned native windows — with none it did nothing — and the widget rendered an empty Container(). The result was a blank card that could not be closed and stayed until compositor restart.

Changes

Waiting state is now readable and closable

  • EphemeralWindowWidget renders a dark terminal container with the launch's execution logs while metaWindowId == null (a progress indicator until the launcher returns), plus a close button. No more blank card.
  • LogsViewer gains an optional textColor so the transcript/cursor stay legible on the dark background (default unchanged).
  • EphemeralWindow carries the launched pid; EphemeralWindowState.launchSelf records it.

Closing can no longer get stuck

  • EphemeralWindowState.closeWindow removes the tile when it owns no native window, mirroring PersistentWindowState.

Cancel a pending launch when a tile is removed

  • AppLaunch now records each tracked launch (supervisor process + veshell-launch-*.service unit), marks a launch once a native window is attributed to the tile, and drops the record when the supervisor exits.
  • Removing a Persistent/Ephemeral tile calls cancelPendingLaunch: if the launch never produced a window it is stopped via systemctl --user stop (SIGTERM to the cgroup — killing the systemd-run supervisor would not stop the service). The untracked fallback kills the shell-owned process.
  • A unit whose window is already displayed under another tile is left running, and a tile that showed a window is never cancelled — closing its window is what makes the app exit.

Tests / verification

  • New src/shell/test/ephemeral_window_close_test.dart: closing a waiting ephemeral window removes it and cancels its pending launch.
  • flutter test — 448 passed.
  • flutter build linux --debug ✓, cargo check ✓, cargo fmt --check ✓.

Notes

  • Scope is intentionally "cancel the pending launch only". A windowed tile whose app keeps running after its window closes is not force-killed.
  • No "no surface arrived" timeout: the window is readable and closable, but not auto-dismissed (documented in docs/design/file_explorer_ephemeral_launch.md).

Closes #128.

…ting stuck (#128)

An ephemeral window that never receives a MetaWindow kept `metaWindowId`
null: its close button called `WindowProviderMixin.closeWindow()`, which
only closes owned native windows, so with none it did nothing and the tile
stayed as a blank, unclosable card.

- Render a dark terminal container with the launch's execution logs (and a
  close button) while an ephemeral window waits for its surface, instead of
  an empty `Container()`. `LogsViewer` gains an optional `textColor` so the
  transcript stays legible on the dark background.
- `EphemeralWindowState.closeWindow` removes the tile when it owns no native
  window, mirroring `PersistentWindowState`.
- Cancel a pending launch when a Persistent/Ephemeral tile is removed: a
  tile that displayed a window is left to exit through its window, while a
  tile still waiting on its first surface stops its tracked
  `veshell-launch-*.service` unit (`systemctl --user stop`). `AppLaunch`
  records each launch, marks it once a window is attributed, and leaves a
  unit whose window is displayed under another tile running.
- Add a regression test for the close/remove + pending-launch cancellation.
@PapyElGringo
PapyElGringo merged commit 45d8584 into main Oct 13, 2026
3 checks passed
@PapyElGringo
PapyElGringo deleted the fix/ephemeral-window-launch-logs branch October 13, 2026 21:46
@PapyElGringo PapyElGringo mentioned this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Windows become blank and cannot be closed after rapidly opening multiple windows

1 participant