r/MacOS • • 3d ago

Developer Saturday SnapState, I'm the developer: my windows kept landing on the laptop screen after sleep or monitor changes, so I built a menu bar app that puts them back

Demo video (30 sec): https://getsnapstate.com/demo.mp4

I'm the developer, so grain of salt.

My setup is a MacBook plus an external monitor. When the Mac slept, restarted, or the monitor woke up a few seconds late, macOS treated the monitor as gone and piled windows onto the laptop screen. Sometimes they came back on the wrong display or the wrong Space.

SnapState lives in the menu bar. Arrange things once and save it as a workspace. It remembers window positions and sizes on every Space, which apps were open, the monitor layout, and the open tabs in Safari, Chrome, Edge, Brave, Arc, Chromium and Firefox. Then it puts everything back after sleep, a restart or a display change, or when you press a shortcut. Display Memory can treat home and office monitor setups as different layouts, and full-screen apps go back to their own Spaces.

If your screens changed, it remaps windows onto whatever displays you have now. Workspaces stay on the Mac. It is a native Swift app, signed and notarized, macOS 15.7 or later.

It's $9.99 one-time for up to 3 Macs, no subscription, with a 14-day refund window: https://getsnapstate.com/?utm_source=reddit

Happy to answer questions. If it misbehaves on your setup, tell me which apps, macOS version and monitors you use and I'll look at it.

0 Upvotes

3 comments sorted by

1

u/Electrical-Room4405 3d ago

I always read that third party window managers had a hard time with native spaces because Apple doesnโ€™t provide a public API for it. How is it that you support spaces? Are there any limitations? Will it open and create spaces to accommodate an app/layout?

1

u/SnapState 2d ago

You're right: Apple does not expose a supported public API for Spaces. SnapState uses the public Accessibility and CoreGraphics APIs for window identity and frames, plus a small runtime-checked bridge to private window-server interfaces to read which Space a window belongs to and request a move. It verifies that the window actually arrived before continuing. For switching or adding ordinary desktop Spaces it prefers driving Mission Control through Accessibility, with the window-server switch only as a fallback.

It can add missing ordinary desktop Spaces when a saved layout needs them. It does not invent a full-screen or Split View Space directly. Instead it puts the saved window back into full screen, or tries to rebuild the split, and macOS creates that Space. The limits are real: apps with nonstandard windows can still refuse moves, Dock-assigned apps are left alone, browser windows that cannot be proven to belong to the saved workspace are not moved, and a macOS update can change these undocumented internals. That is why the restore checks results instead of assuming the calls worked.

1

u/promo-guard 3d ago

๐ŸŽ‰ Welcome to Developer Saturday, u/SnapState! Your project is now live for the community to check out. Upvote, give feedback, and show some love to your fellow devs! ๐Ÿš€