Repository navigation
Description
Bug Report
Expected Behaviour
When wmux is closed while maximized (full-size) on a monitor, relaunching the executable should restore it to that same maximized state on the same monitor.
What Happened
After closing wmux while it was running maximized on my 32″ external monitor, relaunching the .exe brings it back in a very small window — not maximized, and noticeably smaller than any normal default window. I then have to manually maximize it again every time.
Additional Information
Setup
- Laptop: 14″ 3K OLED, 2880 × 1800, 16:10, Windows default scaling ~200%.
- External monitor: 32″ screen, used as the primary work display. wmux runs maximized here.
- Multi-monitor: laptop panel + 32″ external, with very different DPI / scale factors between the two.
- wmux version: 0.10.0
- OS: Windows 11
Technical findings (from the source)
The window-bounds persistence path saves the window rectangle but not the maximized flag, and never re-maximizes on restore:
src/main/index.ts:255-260— onsession:save, onlywin.getBounds()is stored;win.isMaximized()is never recorded.src/main/index.ts:270-273→src/main/window-manager.ts:26-67—createWindow(savedBounds)rebuilds the window from rawwidth/height/x/yand never callswin.maximize().src/main/window-manager.ts:50-51—minWidth: 800,minHeight: 500is the floor a mis-scaled restore can collapse to.src/main/window-manager.ts:29-42— saved-bounds validation only checks screen intersection; no maximize restore, fallback is just 1400×900.
Because Electron bounds are device-independent pixels relative to a specific display, bounds captured on the low-DPI 32″ monitor and re-applied before the window is placed on that monitor (while the high-DPI Zenbook panel is primary) can shrink the window toward the min-size floor — which matches the "very small" result.
Reproduce
- Run wmux on a multi-monitor setup where the monitors have different DPI/scaling (e.g. high-DPI laptop panel + lower-DPI 32″ external).
- Move wmux to the 32″ external monitor and maximize it (full-size).
- Close wmux completely.
- Launch the wmux executable again.
- Observe: wmux opens in a very small window instead of restoring the maximized state on the 32″ monitor.
Summary — proposed changes / likely cause
The maximize state is not part of the persisted session, and on multi-monitor + mixed-DPI setups the saved DIP bounds get re-applied on the wrong display, collapsing the window toward its min size.
Proposed fixes (in src/main/):
- Persist the maximized flag. In the
session:savehandler (index.ts:255-260) also storewin.isMaximized(), and savewin.getNormalBounds()(notgetBounds()) so the pre-maximize rectangle is kept. Add amaximized?: booleanfield toSessionData.windows[]insession-persistence.ts. - Re-maximize on restore. In
createWindow()(window-manager.ts), after creating theBrowserWindow, callwin.maximize()when the saved state was maximized. - Harden multi-monitor restore. Defer applying bounds / maximizing until the target display is resolved (use
screen.getDisplayMatching(savedBounds)and clamp into that display'sworkArea), so mixed-DPI bounds aren't mis-applied to the primary display. Keep the existing off-screen fallback. - Optional: remember which display the window was on and restore there explicitly.
Activity
fix(#57,#59): persist maximize state + fix stuck pane resize
amirlehmam commentedon Jun 25, 2026
Fixed in v0.11.0 🎉 — and thank you for the genuinely excellent bug report; your source-level analysis was spot on and is exactly what I implemented.
Changes (in
src/main/):session:savenow storeswin.isMaximized()and saveswin.getNormalBounds()(the pre-maximize rectangle) instead ofgetBounds(). Added amaximized?: booleanfield toSessionData.windows[].createWindow()callswin.maximize()when the saved state was maximized.screen.getDisplayMatching()and clamped into that display'sworkArea, so DIP bounds captured on the 32″ monitor can no longer be mis-applied to the high-DPI laptop panel and collapse the window toward the min-size floor.This should restore wmux maximized on the same monitor every relaunch. Build: https://github.com/amirlehmam/wmux/releases/tag/v0.11.0 (extract → right-click folder → Properties → Unblock, unsigned). Please reopen if it still misbehaves on your dual-monitor setup.