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.

fix: persist window position as client origin so caption toggle causes no drift

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

authored by

Marco Maroni
Claude Fable 5
and committed by
Tangled
(Jul 15, 2026, 1:16 PM +0300) b22bdad1 a2bbb5fb

+11 -3
+11 -3
CalculatorWindow.cpp
··· 163 163 164 164 POINT pt; 165 165 if (Settings::LoadWindowPos(pt)) { 166 - SetWindowPos(NULL, pt.x, pt.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); 166 + // Saved point is canonical (client origin). Convert to the window 167 + // origin for the style currently in effect. 168 + RECT r = { pt.x, pt.y, pt.x + 1, pt.y + 1 }; 169 + AdjustWindowRectEx(&r, 170 + (DWORD)GetWindowLongPtr(GWL_STYLE), FALSE, 171 + (DWORD)GetWindowLongPtr(GWL_EXSTYLE)); 172 + SetWindowPos(NULL, r.left, r.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER); 167 173 return; 168 174 } 169 175 // First run: anchor bottom-right, just above the notification area. ··· 356 362 357 363 LRESULT CCalculatorWindow::OnExitSizeMove(UINT, WPARAM, LPARAM, BOOL&) 358 364 { 359 - RECT wr; GetWindowRect(&wr); 360 - Settings::SaveWindowPos(POINT{ wr.left, wr.top }); 365 + // Persist the canonical position (client origin), independent of caption state. 366 + RECT rc; GetClientRect(&rc); 367 + ::MapWindowPoints(m_hWnd, NULL, (LPPOINT)&rc, 2); 368 + Settings::SaveWindowPos(POINT{ rc.left, rc.top }); 361 369 return 0; 362 370 } 363 371