MCPcopy Create free account
hub / github.com/78/tenbox / SaveCurrentGeometry

Function SaveCurrentGeometry

src/manager/ui/win32_ui_shell.cpp:252–263  ·  view source on GitHub ↗

Persist current window geometry to settings. Used both on real exit and before hiding to tray, so that on the next launch the window restores to the user's last visible position even if exit happens while tray-hidden.

Source from the content-addressed store, hash-verified

250// before hiding to tray, so that on the next launch the window restores to
251// the user's last visible position even if exit happens while tray-hidden.
252static void SaveCurrentGeometry(Win32UiShell::Impl* p, ManagerService& mgr) {
253 if (!p->hwnd) return;
254 if (!IsWindowVisible(p->hwnd)) return; // would read 0,0 / hidden coords
255 RECT wr;
256 GetWindowRect(p->hwnd, &wr);
257 auto& geo = mgr.app_settings().window;
258 geo.x = wr.left;
259 geo.y = wr.top;
260 geo.width = wr.right - wr.left;
261 geo.height = wr.bottom - wr.top;
262 mgr.SaveAppSettings();
263}
264
265static void ShowMainWindow(Win32UiShell::Impl* p) {
266 if (!p->hwnd) return;

Callers 1

HideMainWindowToTrayFunction · 0.85

Calls 1

SaveAppSettingsMethod · 0.80

Tested by

no test coverage detected