Skip to content

Conversation

@raspopov
Copy link

Saving and restoring of all window sizes and states (normal, minimized, and maximized) has been added, as well as the position of internal window elements, including toolbars.

Changing the type of the stored value WindowGeometry will not cause errors, it will simply be reset to the default. The WindowMaximized setting is restored directly using WindowGeometry and is no longer needed. Only WindowMinimized requires separate processing due to the specifics of displaying the main window when the program starts.

Fixes #69

Saving and restoring of all window sizes and states (normal, minimized,
and maximized) has been added, as well as the position of internal
window elements, including toolbars.

Fixes sanny32#69
@sanny32 sanny32 changed the base branch from main to dev December 19, 2025 06:09
@sanny32 sanny32 self-requested a review December 19, 2025 06:09
@sanny32 sanny32 self-assigned this Dec 19, 2025
Copy link
Owner

@sanny32 sanny32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want restore window minimize state on startup ?

@raspopov
Copy link
Author

Why do you want restore window minimize state on startup ?

TL;DR: To make sure the program takes care of the user and is generally awesome. 😎


Consistency with system behavior and other applications:

Virtually all standard Windows applications, such as Explorer, Notepad, Calc, and Microsoft Office, as well as browsers, remember the position, size, and state of the main window between launches. Users are accustomed to this behavior and perceive it as standard. The absence of this feature makes the program seem "alien" in the Windows ecosystem.

Respect for user preferences:

Each user customizes their workspace by placing windows on specific monitors (especially relevant in multi-monitor configurations), choosing a convenient size, and maximizing or leaving them in their normal state. Restoring these settings demonstrates that the program respects the user's preferences and does not force them to repeat the same actions every time they open the program.

Increased productivity:

Users immediately find themselves in their familiar working environment. This saves time and reduces frustration, especially if the program is launched frequently.

Features of the minimized state

Many users are accustomed to closing programs after minimizing them to the taskbar or tray. If the window expands immediately on the screen the next time it is launched, it is perceived as intrusive behavior and can be annoying.

Some programs, such as messengers, media players, and monitoring utilities, are deliberately launched minimized so as not to distract the user but remain accessible. Saving the minimized state allows you to implement this expected behavior.

If the program was minimized when closed, restoring it in minimized form prevents the window from suddenly appearing on top of other applications. This is especially important when the program starts automatically with the system.

In a multitasking environment, users may minimize a window to temporarily remove it from view but plan to work with it again later. Launching in a minimized state preserves this context.

@sanny32
Copy link
Owner

sanny32 commented Dec 22, 2025

No one of standard Windows applications, such as Explorer, Notepad, Calc, and Microsoft Office do not restore it minimize state.
Sorry, but I can`t accept this PR.

@sanny32 sanny32 closed this Dec 22, 2025
@raspopov
Copy link
Author

raspopov commented Dec 22, 2025

No one of standard Windows applications, such as Explorer, Notepad, Calc, and Microsoft Office do not restore it minimize state.

I would like to point out that the standard Windows 11 Calc application remains minimized even when the user logs out manually. Modern applications tend to preserve the desktop layout between reboots, especially if the reboot is due to a Windows update.

Sorry, but I can`t accept this PR.

Okay, I can exclude minimizing from the saved settings. It's an additional free feature anyway.

The main feature of PR is fixing the window normal position on another monitor when the window was closed while maximized.

@sanny32 sanny32 reopened this Dec 23, 2025
@sanny32 sanny32 self-requested a review December 23, 2025 05:51
Copy link
Owner

@sanny32 sanny32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove saving/restoring window minimize state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request to save main window state

2 participants