mirror of
https://github.com/ForLoopCodes/legacy-notepad.git
synced 2026-04-26 12:25:50 +03:00
[PR #22] [MERGED] Add window size and position persistence #26
Labels
No labels
bug
bug
documentation
enhancement
good first issue
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/legacy-notepad#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ForLoopCodes/legacy-notepad/pull/22
Author: @Copilot
Created: 2/5/2026
Status: ✅ Merged
Merged: 3/4/2026
Merged by: @ForLoopCodes
Base:
main← Head:copilot/remember-window-size-position📝 Commits (5)
eba9630Initial plan893af16Add window size and position persistence to registry05c85f3Improve window position handling for multi-monitor and off-screen scenariosf32786fFix signed/unsigned conversion for window coordinates using reinterpret_castc7f73edUse static_cast for DWORD to int conversion with explanatory comments📊 Changes
4 files changed (+113 additions, -2 deletions)
View changed files
📝
src/core/types.h(+4 -0)📝
src/main.cpp(+17 -1)📝
src/modules/settings.cpp(+90 -1)📝
src/modules/settings.h(+2 -0)📄 Description
Implements window geometry persistence to registry, matching native Notepad behavior.
Implementation
windowX,windowY,windowWidth,windowHeighttoAppStatewith 640×480 defaultLoadWindowSettings()/SaveWindowSettings()functions write toHKEY_CURRENT_USER\Software\LegacyNotepadCreateWindowExW(), save onWM_DESTROYusingGetWindowPlacement().rcNormalPositionEdge Cases
static_cast<int>(DWORD)round-tripMonitorFromRect()validation resets toCW_USEDEFAULTif no monitor intersectionrcNormalPositionso window doesn't reopen maximized unintentionallyRegistry keys:
WindowX,WindowY,WindowWidth,WindowHeight(REG_DWORD)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #22] Add window size and position persistenceto [PR #22] [MERGED] Add window size and position persistence