MSW: Fix wxTextCtrl border switching from dark mode (PR #26794)

10 views
Skip to first unread message

Steve Cornett

unread,
Aug 6, 2026, 3:04:51 PM (3 days ago) Aug 6
to wx-...@googlegroups.com, Subscribed

The problem fixed is that when creating a wxTextCtrl with default themed border in dark mode and then switching to light mode, the border remains dark. To repro, run the widgets sample, set the page to Text, restart in dark mode, and switch to light mode.

Image: image (view on web)

This problem was introduced in d5aacc4. The problem is caused by wxTextCtrl::CanApplyThemeBorder() returning true in dark mode. This causes the control to be created without any border style flags. This is not a problem in dark mode because in that case we draw a custom border. But upon switching to light mode, the control does not redraw a border, apparently because it thinks it has no border. The default system WM_NCPAINT processing does nothing.

The fix is to restore wxTextCtrl::CanApplyThemeBorder() as it worked before d5aacc4. Instead of relying on that function to determine whether our custom border is drawn, the WM_NCPAINT handler is modified to detect this condition. This way, the control is always created consistently, regardless of dark mode.


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

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

Commit Summary

  • 3b67fa9 Fix wxTextCtrl border switching from dark mode

File Changes

(2 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/26794@github.com>

VZ

unread,
Aug 6, 2026, 4:08:56 PM (3 days ago) Aug 6
to wx-...@googlegroups.com, Subscribed

Closed #26794 via 4227d13.


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/26794/issue_event/29085661481@github.com>

Reply all
Reply to author
Forward
0 new messages