-
Couldn't load subscription status.
- Fork 1.1k
fix #13873 [DarkMode]: TabControl doesn't render tab titles correctly when SizeMode = Fixed #13878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rectly when SizeMode = Fixed
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13878 +/- ##
===================================================
+ Coverage 77.11833% 77.12514% +0.00681%
===================================================
Files 3273 3273
Lines 644931 644922 -9
Branches 47692 47695 +3
===================================================
+ Hits 497360 497397 +37
+ Misses 143900 143850 -50
- Partials 3671 3675 +4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where TabControl doesn't render tab titles correctly when SizeMode is set to Fixed in dark mode. The issue occurs because setting TabSizeMode triggers RecreateHandle, which interferes with the dark mode rendering flow.
- Adds conditional logic to only call RecreateHandle when necessary in dark mode scenarios
- Ensures proper handle recreation when dark mode is enabled and the handle already exists
Fixes #13873
Root cause
When TabSizeMode is set , it will trigger RecreateHandle, which in turn will trigger OnHandleCreated, ApplyDarkModeOnDemand, and eventually PInvoke.SetWindowTheme.
I think this might break the normal code flow. Setting TabSizeMode advances some procedures.
Proposed changes
Screenshots
Before
After
Test methodology
Microsoft Reviewers: Open in CodeFlow