anomalyco / anomalyco/opencode
[Bug] Desktop (Windows): window controls (minimize/maximize/close) disappear permanently after fullscreen; state persists across restarts and reinstall
@Hona is already working on this.
Since Sep 13, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
On the Windows desktop app, the native window controls (minimize / maximize / close) permanently disappear once the window enters fullscreen. Because the fullscreen state is persisted to disk and restored on every launch, the app keeps starting in fullscreen (with no controls), and the only way to close it re-saves the fullscreen state — a self-perpetuating lock-in. Uninstalling and reinstalling does not fix it, because the user-data directory is not removed.
A secondary symptom is that Alt+Tab sometimes fails to bring other apps to the foreground while the frameless fullscreen window is active.
Environment
- opencode desktop
1.18.30(Electron build,@opencode-aidesktop) - Windows 11 家庭版 (Chinese),
10.0.26200(Build 26200), AMD64 - Install path:
%LOCALAPPDATA%\Programs\@opencode-aidesktop - userData:
%APPDATA%\ai.opencode.desktop
Steps to reproduce
- Launch opencode desktop. It opens normally (windowed) with the three window controls visible.
- Press F11 (the native menu's
togglefullscreenrole accelerator on Windows) — intentionally or accidentally. The window goes fullscreen and all window controls disappear. - Close the app while it is still fullscreen (there is no close button, so via Alt+F4 / taskbar / Task Manager).
- Relaunch. The app now starts fullscreen with no window controls again.
- Repeat step 3–4 forever. Reinstalling the app does not help.
Root cause (from resources/app.asar)
-
On Windows the main window is created frameless with a window-controls overlay:
// createMainWindow() ...process.platform === "win32" ? { frame: false, titleBarStyle: "hidden", titleBarOverlay: overlay({ mode }) } : {},The min/max/close buttons only exist as part of the title-bar overlay, so in fullscreen they are gone.
-
Window state is persisted per window with
electron-window-statein
%APPDATA%\ai.opencode.desktop\window-state-<windowId>.json, includingisFullScreen:// electron-window-state state.isMaximized = win.isMaximized(); state.isFullScreen = win.isFullScreen(); ... function manage(win) { if (config.maximize && state.isMaximized) win.maximize(); if (config.fullScreen && state.isFullScreen) win.setFullScreen(true); // restored on launch ... } -
When the app is closed while fullscreen,
isFullScreen: trueis written. On the next launchstate.manage(win)callswin.setFullScreen(true), so the app always starts fullscreen. -
A concrete corrupted state file observed:
{"width":1292,"height":804,"x":4,"y":5,"displayBounds":{"x":0,"y":0,"width":1707,"height":960},"isMaximized":false,"isFullScreen":true} -
The uninstaller does not delete
%APPDATA%\ai.opencode.desktop, so the bad state survives reinstall.
Suggested fixes
- Don't restore
isFullScreenon startup (or reset it tofalsewhen persisting), so the window can never boot into a state without controls; or - Always keep an escape hatch: bind
Escapeto leave fullscreen, and show a hint when fullscreen is active; and/or - Add a
--reset-window-stateCLI flag (or clear the file on upgrade) to recover the app without a working title bar; and - Consider clearing persisted window state on uninstall.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.