Add dark mode support to wxMSW task dialog-based dialogs (PR #26570)

6 views
Skip to first unread message

VZ

unread,
Jun 7, 2026, 8:47:21 PM (8 hours ago) Jun 7
to wx-...@googlegroups.com, Subscribed

This is #26311 with cleanup and some fixes.

Unfortunately there are still ressource leaks remaining: every time a message box is shown, 3 GDI handles (and 1 USER one) are leaked. I can't figure out what they are: Application Verifier doesn't show anything at all and GDIView shows the total number of handles growing while each column remains stable. It also shows the total number increasing by 6, unlike the task manager which only shows 3 leaked handles.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26570

Commit Summary

  • 92254ce Factor out wxIsSystemColourChange() helper function
  • 8e2ac38 Add dark mode support for task dialog-based dialogs
  • 2ebde40 Remove WM_SETTINGCHANGE handling from task dialog proc
  • 091ba7a Remove unnecessary member initialization in TDPageState ctor
  • 0dce46f Use AutoHBRUSH instead of manually allocating/deleting HBRUSHes
  • 12eed00 Make IUIAutomation pointer a local variable
  • 8048524 Return TRUE, not 1, when handling WM_ERASEBKGND
  • 3ed49f0 Use safer wxIID_PPV_ARGS() instead of cast to "void**"
  • 739cefe Localize GET_[BGR] macros
  • e1ca1dd Use wxColour and wxUxThemeHandle instead of raw Windows API
  • 8b2b906 Don't define CLSID_CUIAutomation and IID_IUIAutomation ourselves
  • fac69ca Add default ctor and move assignment to wxUxThemeHandle
  • 1c6d7e9 Don't use thread-local in task dialog dark mode support code
  • a5979f4 Add helper GetHWNDFromElement(IUIAutomationElement) function
  • db39a68 Stop using wxBasicString unnecessarily
  • e0a95d5 Rename LPARAM parameter to standard "lParam" name
  • dede73a Don't store IUIAutomation in TDEnumData
  • bd03fbb Don't pass IUIAutomation as parameter to TDApplyToChildren()
  • 88b1caf Reuse GetWindowDPI() from task dialog dark mode code
  • 026e93d Check for error after calling ::SetWindowTheme()
  • 6d45067 Remove TDPageState::CloseThemes()
  • 683d735 Remove TDPageState::hTDS which was same as hTD
  • 3969155 Remove TDPageState::isDark
  • 23409e0 Don't do anything in TDPaintGlyphs() when using native dark theme
  • 847561b Extend wxUxThemeHandle and use it more in dark task dialog code
  • 3de0aec Add WinStructWordSize<> helper and use it
  • 26bf503 Use recently added wxUxThemeHandle::GetFont()
  • 5acd403 Reformat task dialog dark mode support code
  • 8ab0173 Add GetCurrentAutomationId() helper
  • b5baa3e Remove unnecessary "static" from functions in anonymous namespace
  • 361dbd9 Use wx-specific subclass IDs
  • 272875a Add wrappers around window subclassing functions
  • a2d7a75 Fix HBRUSH leaks in task dialog dark mode code

File Changes

(24 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26570@github.com>

VZ

unread,
Jun 7, 2026, 9:02:53 PM (8 hours ago) Jun 7
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • 2580e62 Include wx/brush.h to fix the build when not using PCH
  • c2f3ee8 Disable support for dark mode in task dialog for wxUniv


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26570/before/a2d7a75a1e447d20dc814f8512324e5681658ed2/after/c2f3ee883fbc8eb968a7f310c5b81d8a94e93a8e@github.com>

VZ

unread,
Jun 7, 2026, 9:06:31 PM (8 hours ago) Jun 7
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • 1ec6163 Include wx/brush.h to fix the build when not using PCH
  • 37ff69e Disable support for dark mode in task dialog for wxUniv


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26570/before/c2f3ee883fbc8eb968a7f310c5b81d8a94e93a8e/after/37ff69e8d42968fe5185f651b9fc9c06e8e6b94c@github.com>

VZ

unread,
Jun 7, 2026, 9:11:11 PM (8 hours ago) Jun 7
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 97c1f3b Ignore unused parameters when dark mode support is disabled


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26570/before/37ff69e8d42968fe5185f651b9fc9c06e8e6b94c/after/97c1f3bbfb18fba8e534bc14a73e57653384a6da@github.com>

VZ

unread,
Jun 7, 2026, 9:19:41 PM (8 hours ago) Jun 7
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 53d16f0 Fix HICON leak in task dialog dark mode support code


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26570/before/97c1f3bbfb18fba8e534bc14a73e57653384a6da/after/53d16f014433f2befbe789fb18d2c8f2e942bca6@github.com>

VZ

unread,
Jun 7, 2026, 9:22:34 PM (8 hours ago) Jun 7
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26570)

I was looking for the leaks in a wrong place, we've been actually leaking HICONs, of all things... AFAICS this is fixed now, neither GDIView nor Process Explorer show any handles growth when repeatedly opening and closing a message box.

There is still the fact that a lot of resources are allocated the first time this happens, but I think we can live with it, so this should be ready for merge if nobody sees any big problems with it.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26570/c4644746106@github.com>

Reply all
Reply to author
Forward
0 new messages