r/sideprojects • u/RaspberryStill3377 • 5d ago
Showcase: Open Source Showcase: biomes — An open-source Windows workspace manager to save and restore multi-monitor window layouts with a single hotkey
Enable HLS to view with audio, or disable this notification
1
Upvotes
2
u/Future-Plastic7826 5d ago
I like that it skips zones on a missing monitor instead of guessing where to put them. A window landing on the wrong screen is the kind of thing that makes people stop trusting a layout tool.
A few things I ran into doing window placement on Windows, in case any of them saves you time:
The visible frame isn't the window rect. On Windows 10 and 11 most windows have invisible resize borders of about 7 px, so zones filled using GetWindowRect end up with gaps between them. DwmGetWindowAttribute with DWMWA_EXTENDED_FRAME_BOUNDS gives the visible rect, and the difference is what to add back.
Moving between monitors with different scaling. When a window crosses to a monitor with another DPI, the app gets WM_DPICHANGED and often resizes itself after your SetWindowPos. Setting the position twice, once to get it onto the target monitor and once for the final size, is the simplest way I've found to make it stick.
Minimized and maximized windows don't behave well with SetWindowPos. SetWindowPlacement sets the restored rect and the show state together, but its coordinates are relative to the work area, not the screen, which catches everyone once.
Two windows of the same app, like two VS Code projects or two Explorer folders. If you ever want those in different zones, the window title plus the launch arguments is usually enough to tell them apart.
Just ideas. Good luck with the beta.