fix(window): restore WindowChrome resize border thickness when restored from Maximized (closes #246) - #248
Merged
ghost1372 merged 1 commit intoSep 5, 2026
Conversation
Owner
|
Thank you |
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.
Summary
Fixes #246 (and upstream #1793) where an
hc:Windowinitialized withWindowState="Maximized"could not be resized and lacked resize cursor affordances after being restored toNormal.Root Cause
WindowState == WindowState.Maximizedat load time,OnLoadedsetschrome.ResizeBorderThickness = new Thickness(0)to prevent edge stretching while maximized.SC_RESTORE, or title-bar drag),OnStateChangedupdatedBorderThicknessandNonClientAreaHeight, but never restoredWindowChrome.ResizeBorderThickness.OnPropertyChangedis not reliably called by WPF during Win32-initiated state changes (e.g., system commands or snap gestures), leavingResizeBorderThicknessstuck at 0.Solution
Window.cs, invokedApplyWindowChrome(WindowState)insideOnStateChanged(EventArgs e)so that every transition back toWindowState.Normaldynamically re-applies the proper resize border thickness (6px) or clears it ifMaximized/NoResize.Window!.cs, ensuredResizeMode == ResizeMode.NoResizeis explicitly honored when calculatingchrome.ResizeBorderThickness.Verification
HandyControl_Net_GE45.csprojtargetingnet8.0-windowscleanly with 0 compilation errors.