anomalyco / anomalyco/opencode

[Bug] Desktop (Windows): window controls (minimize/maximize/close) disappear permanently after fullscreen; state persists across restarts and reinstall

Open
#48,790 0 comments 0 reactions 1 assignee View on GitHub

@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
  1. Launch opencode desktop. It opens normally (windowed) with the three window controls visible.
  2. Press F11 (the native menu's togglefullscreen role accelerator on Windows) — intentionally or accidentally. The window goes fullscreen and all window controls disappear.
  3. Close the app while it is still fullscreen (there is no close button, so via Alt+F4 / taskbar / Task Manager).
  4. Relaunch. The app now starts fullscreen with no window controls again.
  5. Repeat step 3–4 forever. Reinstalling the app does not help.
Root cause (from resources/app.asar)
  1. 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.

  2. Window state is persisted per window with electron-window-state in
    %APPDATA%\ai.opencode.desktop\window-state-<windowId>.json, including isFullScreen:

    // 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
      ...
    }
    
  3. When the app is closed while fullscreen, isFullScreen: true is written. On the next launch state.manage(win) calls win.setFullScreen(true), so the app always starts fullscreen.

  4. 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}
    
  5. The uninstaller does not delete %APPDATA%\ai.opencode.desktop, so the bad state survives reinstall.

Suggested fixes
  • Don't restore isFullScreen on startup (or reset it to false when persisting), so the window can never boot into a state without controls; or
  • Always keep an escape hatch: bind Escape to leave fullscreen, and show a hint when fullscreen is active; and/or
  • Add a --reset-window-state CLI 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.