MSW: Refresh tabs after changing tabs programmatically in dark mode (PR #26329)

25 views
Skip to first unread message

RobertRoeb

unread,
Mar 31, 2026, 3:42:18 AM (4 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed
  • This did not occur in dark mode, leaving the tabs a wrong state
  • Fixes #26281

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

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

Commit Summary

  • 7f5708b Refresh tabs after changing tabs programmatically

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26329@github.com>

VZ

unread,
Mar 31, 2026, 5:37:12 PM (3 days ago) Mar 31
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.


In src/msw/notebook.cpp:

> @@ -354,6 +354,10 @@ int wxNotebook::SetSelection(size_t nPage)
 
             (void)TabCtrl_SetCurSel(GetHwnd(), nPage);
 
+            /// MSW does not redraw the tab in darkmode
+            if (wxSystemSettings::GetAppearance().IsDark())

This almost certainly should be wxMSWDarkMode::IsActive(), as we only want to do this when our dark mode support is used, not just because the system is using dark mode.

Could you please check that this works?


Reply to this email directly, view it on GitHub, or unsubscribe.

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

RobertRoeb

unread,
Apr 1, 2026, 1:17:45 PM (2 days ago) Apr 1
to wx-...@googlegroups.com, Subscribed

@RobertRoeb commented on this pull request.


In src/msw/notebook.cpp:

> @@ -354,6 +354,10 @@ int wxNotebook::SetSelection(size_t nPage)
 
             (void)TabCtrl_SetCurSel(GetHwnd(), nPage);
 
+            /// MSW does not redraw the tab in darkmode
+            if (wxSystemSettings::GetAppearance().IsDark())

Yes, indeed. I believe the other ports work differently - wxSystemSettings::GetAppearance().IsDark() returns true if the app is dark, no matter what the system is so assumed this to be the same on MSW. Will check again if I have time.


Reply to this email directly, view it on GitHub, or unsubscribe.

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

Reply all
Reply to author
Forward
0 new messages