Fix Button click after Dark to Light color mode switch#14785
Open
abineshPalanisamy wants to merge 2 commits into
Open
Fix Button click after Dark to Light color mode switch#14785abineshPalanisamy wants to merge 2 commits into
abineshPalanisamy wants to merge 2 commits into
Conversation
Added fix for the Fix_Issue_13636
Updated the review correction and added unit test cases
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.
Fixes #13636
Proposed changes
WM_SETTINGCHANGEwithImmersiveColorSetinControl.WndProc.OnSystemColorsChangedwhen the application color mode is set and the OS dark/light mode changes.ButtonBase.OnSystemColorsChangedto refresh the owner-draw state.Button,CheckBox, andRadioButtonupdate their dark-mode rendering path after OS color mode changes.Root cause
WM_SETTINGCHANGEwithImmersiveColorSet.Button.Clickto stop firing in the Dark-to-Light transition scenario.Customer Impact
Button.Clickstops working after switching the Windows OS color mode from Dark to Light.Button,CheckBox, andRadioButton.Regression?
Risk
ImmersiveColorSetsystem setting changes and refreshing ButtonBase owner-draw state.WM_SETTINGCHANGEbehavior is preserved for unrelated settings.OnSystemColorsChangedflow instead of adding separate Button-specific system message handling.Screenshots
Before
ButtonClick_Before_fix.mp4
After
ButtonClick_After_fix.mp4
Test methodology
Application.SetColorMode(SystemColorMode.System).ButtonCheckBoxRadioButtonFlatStylevalues:StandardSystemFlatPopupWM_SETTINGCHANGEwithImmersiveColorSet.ButtonBaserefreshes owner-draw state on system color changes.Accessibility testing
Test environment(s)
Microsoft Reviewers: Open in CodeFlow