2.1 KiB
App switcher close menu
Feature branch: feat/app-controls, based on main so it can be
reviewed independently. The combined build lives on build/all-features.
With the app switcher focused, long-press or tap-then-hold opens the existing shell-owned System menu. “Close current app” closes the selected window when it is closeable. It is absent for the pinned launcher (the large application grid). “Close all apps” closes every closeable window, including background windows and multiple windows belonging to one app. Pinned windows remain available.
Both actions reuse the shell's normal close/cleanup path. The menu closes before the windows do, and focus returns to the switcher. It selects “Close current app” by default when available, otherwise “Focus app switcher”. With no closeable windows, “Close all apps” is disabled. No new preferences or persistence format are introduced.
Software: tests/app-switcher-menu.test.cjs covers both gestures, apps claiming
holds/hold-to-talk, launcher exclusion, captured close targets, cancellation,
default selection, multiple windows, reentrant removal, callback errors and
screen-off behavior. Existing in-app gesture routing remains unchanged.
Manual validation on glasses remains pending:
- Open several apps, focus the app switcher, and open the menu with both gestures.
- Close the selected app; verify its surface disappears and other apps remain.
- Select the large application grid; verify “Close current app” is absent.
- Use “Close all apps”; verify the launcher remains usable and apps can reopen.
- Repeat for left/right/bottom/popup switcher positions and with a running game, a hold-to-talk app and an app exposing multiple windows.
- Check cancel/back closes nothing; confirming the initial selection closes the current app when available. Check both menu gestures still work normally when focus is inside an app.
Closing windows retains each app's existing lifecycle semantics; it does not uninstall apps or reset their preferences. Existing app-specific shutdown behavior (such as a remote terminal connection) is the same as closing its window normally.