Fix mini window restoring to full size when moved after maximize#104
Merged
Conversation
Resizing a maximized window keeps its zoomed flag set, so dragging the mini window triggered the shell's restore-on-drag and snapped it back to full-mode size. Restore the presenter first when entering mini mode. Fixes #102 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entering mini from a maximized window now remembers that state, and expanding maximizes again after the windowed rect is applied - so the restore rect stays the windowed size, not the mini rect. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Toggling mini mode while the window is maximized only shrinks the HWND with
SetWindowSize— the internal zoomed (maximized) flag stays set. When the user then drags the mini window (WM_NCLBUTTONDOWN/HTCAPTION), Windows performs its standard restore-on-drag for maximized windows and snaps the window back to the saved restore rect (full-mode 950x600).This also explains the reported symptoms: stable repro within one session (the restore rect keeps the pre-maximize size), gone after an app restart (fresh process has no maximize record).
Fix
ApplyWindowMode): if the presenter isMaximized, callpresenter.Restore()before resizing. The zoomed flag is cleared, so dragging the mini window is a plain move._restoreMaximizedOnExpand; expanding then re-maximizes after the 950x600 windowed rect is applied. Mode round-trip is symmetric (maximized -> mini -> maximized), and becauseMaximize()runs after the windowed rect is set, the system-captured restore rect stays the windowed size — manually un-maximizing later yields a normal 950x600 window, not a mini-sized one.Verification
Debug build passes (only pre-existing WMC1510 warnings in
AppSettingsExpander.xaml). UIA runtime round-trip:IsZoomed=TrueIsZoomed=False, 330x136 DIP (drag can no longer trigger restore-on-drag)IsZoomed=True(returns to maximized)IsZoomed=False, 950x600 DIP (sane restore rect)Fixes #102
🤖 Generated with Claude Code