A simple, small calculator placed discreetly near the Windows Taskbar or anywhere on the screen
0

Configure Feed

Select the types of activity you want to include in your feed.

docs: align spec/plan with per-monitor clamp, fix offset direction, record foreground-denied side effect

Update the plan and spec to describe the work-area clamp as per-monitor
(MonitorFromWindow + GetMonitorInfo) rather than SPI_GETWORKAREA, matching
the shipped code. Fix the plan's description of the one-time reinterpreted
saved-position offset: the window appears one caption height higher, not
lower. Add an accepted side effect to the spec: if SetForegroundWindow is
denied when the window is shown (e.g. the single-instance second-launch
path), the window appears chromeless until clicked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Marco Maroni (Jul 15, 2026, 11:13 AM +0200) ff1c4bfe 735d2722

+13 -7
+6 -5
docs/superpowers/plans/2026-07-15-auto-hide-caption.md
··· 85 85 AdjustWindowRectEx(&r, (DWORD)style, FALSE, 86 86 (DWORD)GetWindowLongPtr(GWL_EXSTYLE)); 87 87 88 - // Guard: never push the top edge above the work area. 89 - RECT work; SystemParametersInfo(SPI_GETWORKAREA, 0, &work, 0); 90 - if (r.top < work.top) 91 - ::OffsetRect(&r, 0, work.top - r.top); 88 + // Guard: never push the top edge above the work area of the window's monitor. 89 + MONITORINFO mi = { sizeof(mi) }; 90 + if (::GetMonitorInfo(::MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi) 91 + && r.top < mi.rcWork.top) 92 + ::OffsetRect(&r, 0, mi.rcWork.top - r.top); 92 93 93 94 SetWindowPos(NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, 94 95 SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE); ··· 170 171 } 171 172 ``` 172 173 173 - Note: positions saved by older builds were window origins; they are reinterpreted as client origins exactly once (the window appears one caption height lower), then the position is stable forever after the first drag. 174 + Note: positions saved by older builds were window origins; they are reinterpreted as client origins exactly once (the window appears one caption height higher), then the position is stable forever after the first drag. 174 175 175 176 - [ ] **Step 3: Build** 176 177
+7 -2
docs/superpowers/specs/2026-07-15-auto-hide-caption-design.md
··· 34 34 with `AdjustWindowRectEx`, and pass position + size to the same `SetWindowPos` call 35 35 that applies `SWP_FRAMECHANGED`. 36 36 - Safety clamp: if growing upward would push the window top above the work area top, 37 - clamp to the work area (in practice the window sits near the taskbar, so this is a 38 - guard, not an expected path). 37 + clamp to the work area of the window's own monitor (`MonitorFromWindow` + 38 + `GetMonitorInfo`) — not the primary monitor's — so the clamp behaves correctly on a 39 + secondary monitor positioned above the primary. In practice the window sits near the 40 + taskbar, so this is a guard, not an expected path. 39 41 40 42 ## Position persistence — canonical form 41 43 ··· 60 62 functional impact. 61 63 - The frame appears/disappears instantly (no animation); with DWM on Windows 11 the 62 64 repaint is near-imperceptible. 65 + - If `SetForegroundWindow` is denied when the window is shown (e.g. the single-instance 66 + second-launch path), the window appears chromeless until clicked — known behavior, not 67 + a bug. 63 68 64 69 ## Components touched 65 70