Vibecoding a Mac window fix: the AI wrote the code fast, macOS was the hard part

For years my Mac moved all my windows onto one monitor every time it woke up, unlocked or went back on the dock. I finally sat down with an AI to build a small menu bar fix for myself, and had something working in under 24 hours.

What surprised me was where the time went. The code came fast. Understanding what macOS actually does took the rest.

Sleep is a disconnect. Most external monitors drop their link when the Mac sleeps, so macOS moves their windows to a screen that's still there and never moves them back.

Identical monitors can look like the same monitor. Many report the same serial number, so "which screen was this window on?" is not a trivial question.

Saving on a timer is a trap. The obvious approach is to snapshot window positions every few seconds. But if a snapshot runs right after a wake, you save the mess macOS just made instead of your real layout.

None of that is in the code an AI gives you on the first try. You only learn it by living with the problem.

What platform quirk ate most of your time on something you vibecoded?

16 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.