<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>

</li>
</ul>
</li>
</ul>
<p dir="auto">"electron": "^4.2.12",</p>
<ul dir="auto">
<li><strong>Operating System:</strong><br>
Windows 10 home Chinese
<ul dir="auto">
<li>

</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong><br>
6.0.0 +
<ul dir="auto">
<li>

</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>

<p dir="auto">Reduce the window to the minimum and click to maximize. In the Restore window, the size of the window is the same as the original size, and the window cannot be reduced</p>
<h3 dir="auto">Actual Behavior</h3>

<p dir="auto">Reduce the window to the minimum, and click to maximize it. In the Restore window, the window size is larger than the original size, and the window can be reduced</p>
<h3 dir="auto">To Reproduce</h3>

<p dir="auto">Reduce the vscode editor to the smallest window, click to maximize and restore the window. The size of the window is larger than the original size, and the window can be reduced</p>



<h3 dir="auto">Screenshots</h3>

<h3 dir="auto">Additional Information</h3>
<p dir="auto">In the borderless windows of windows computers, the minimum window width is 800. Drag it to the place where the minimum window cannot be dragged, that is, the window width is 800. Click our customized maximize button. Does the maximize button change the restore button? Click the restore button. It is found that the window has not been restored. The window width may be 814 instead of 800. You can still drag it to the left. Wechat pin can do it, vscode can't.</p>
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>7.1.2 - 9.0.0-beta.3 (and presumably later versions until this bug is fixed)</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>Windows 10 pro (1909)</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>7.1.1</li>
</ul>
</li>
</ul>
<h3 dir="auto">Preconditions</h3>
<ul dir="auto">
<li>Window is frameless</li>
<li>Window has minimum size</li>
<li>Window size is minimum size</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<ul dir="auto">
<li>Window is maximized</li>
<li>Window is unmaximized</li>
<li>Window has the same size as before the maximization</li>
</ul>
<h3 dir="auto">Actual Behavior</h3>
<ul dir="auto">
<li>Window is maximized</li>
<li>Window is unmaximized</li>
<li>Window is slightly higher and wider than before the maximization</li>
</ul>
<h3 dir="auto">To Reproduce</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone -b frameless-minsize-maximize-unmaximize-bug https://github.com/christian-judt/electron-quick-start.git
cd electron-quick-start
npm install
npm start"><pre class="notranslate"><code class="notranslate">git clone -b frameless-minsize-maximize-unmaximize-bug https://github.com/christian-judt/electron-quick-start.git
cd electron-quick-start
npm install
npm start
</code></pre></div>
<h3 dir="auto">Additional Information</h3>
<ul dir="auto">
<li>This seems to be a reappearing problem. (for the last occurence see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="337487042" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/13533" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/13533/hovercard" href="https://github.com/electron/electron/issues/13533">#13533</a>)</li>
<li>A similar problem with "minimize-restore" instead of "maximize-unmaximize" has appeared in Electron Version 7.1.10. (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="571258121" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/22393" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/22393/hovercard" href="https://github.com/electron/electron/issues/22393">#22393</a>)</li>
</ul>
<h3 dir="auto">Other maybe related issues</h3>
<ul dir="auto">
<li>[Windows] Frameless window size increase on a maximize, unmaximize sequence <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="100851037" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/2498" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/2498/hovercard" href="https://github.com/electron/electron/issues/2498">#2498</a></li>
<li>Windows: Restore (after minimize) to wrong window size <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="188899049" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/7951" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/7951/hovercard" href="https://github.com/electron/electron/issues/7951">#7951</a></li>
<li>maximize, minimize, restore incorrect size <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="380469913" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/15702" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/15702/hovercard" href="https://github.com/electron/electron/issues/15702">#15702</a></li>
<li>Electron 6 - restore after minimize has wrong window size <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="482047660" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/19816" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/19816/hovercard" href="https://github.com/electron/electron/issues/19816">#19816</a></li>
</ul>