Skip to content

Conversation

Epica3055
Copy link
Member

@Epica3055 Epica3055 commented Sep 17, 2025

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

  • when TabSizeMode is set and if it's dark mode and handle is created then RecreateHandle

Screenshots

Before

image

After

image

Test methodology

  • manual
Microsoft Reviewers: Open in CodeFlow

@Epica3055 Epica3055 requested a review from a team as a code owner September 17, 2025 03:10
@github-actions github-actions bot added the area-DarkMode Issues relating to Dark Mode feature label Sep 17, 2025
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.12514%. Comparing base (04dbda2) to head (6ba607b).
⚠️ Report is 12 commits behind head on main.

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     
Flag Coverage Δ
Debug 77.12514% <75.00000%> (+0.00681%) ⬆️
integration 18.99162% <0.00000%> (+0.00303%) ⬆️
production 51.96533% <75.00000%> (+0.01447%) ⬆️
test 97.41256% <ø> (ø)
unit 49.37754% <75.00000%> (+0.01231%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeafShi1 LeafShi1 requested a review from Copilot September 17, 2025 06:01
Copy link
Contributor

@Copilot Copilot AI left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DarkMode Issues relating to Dark Mode feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DarkMode]: TabControl doesn't render tab titles correctly when SizeMode = Fixed
2 participants