[Bug]: Desktop window always reopens on the primary monitor, forgetting the display it was last used on#4841

openedJul 29, 2026byLleftytennis

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

Requires two monitors.

  1. Launch the desktop app on a multi-monitor setup.
  2. Move the window to the secondary monitor.
  3. Maximize it there.
  4. Quit the app.
  5. Relaunch it.

Expected behavior

The window reopens maximized on the secondary monitor — the display it was last used on.

Actual behavior

The window reopens maximized on the primary monitor, every time. The monitor choice is never remembered across restarts.

The persisted state shows why. ~/.t3/userdata/desktop-settings.json after the steps above:

json
1{"mainWindowBounds":{"x":410,"y":86,"width":1100,"height":780},"mainWindowMaximized":true}

mainWindowBounds stores the window's normal (pre-maximize) bounds, which here are the default centered position on monitor 1 — even though the window was maximized on monitor 2. Nothing in the persisted state identifies the display the window actually occupied.

On startup, resolveInitialMainWindowBounds in apps/desktop/src/window/DesktopWindow.ts picks a position from mainWindowBounds alone (accepting it if it fits any connected display), then maximize() is applied on ready-to-show. Since those bounds sit on monitor 1, the window maximizes on monitor 1.

The root cause is that normal bounds are not sufficient to identify a monitor: for a maximized window they are its last un-maximized geometry, which frequently points at a different display than the one it is on.

Impact

Minor bug or occasional failure

Version or commit

main @ 49c0d96ed

Environment

macOS 26.5.2 (Darwin 25.5.0), Node v24.18.0, two 4K displays both scaled to 1920x1080

Workaround

Manually drag the window back to the intended monitor after each launch.

Note

This is an automated response from a bot acting on maria's behalf. This issue has had no activity since 2026-07-29. Is it still relevant on the current version? If so, your version and OS would help.