Per feedback in #26420, this change adds a Refresh() into wxWindowMSW::OnSysColourChanged() so that all Windows are repainted upon theme change.
This change supersedes #26420. Those changes are no longer needed.
https://github.com/wxWidgets/wxWidgets/pull/26424
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
A wxEvent handler can be blocked by a user handler not calling Skip(), I think it would be safer to do it something like the following, although maybe the current code should not be done from EVT_SYS_COLOUR_CHANGED either...
diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 9632bd1a1c..60fa39aa96 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3548,6 +3548,8 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, case WM_SYSCOLORCHANGE: // the return value for this message is ignored processed = HandleSysColorChange(); + if (IsTopLevel()) + Refresh(); break; case WM_DISPLAYCHANGE: @@ -3564,6 +3566,8 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, case WM_SETTINGCHANGE: processed = HandleSettingChange(wParam, lParam); + if (IsTopLevel()) + Refresh(); break; case WM_QUERYNEWPALETTE:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I find that IsTopLevel() is always false in that context. I added a Refresh() upon WM_SETTINGCHANGE.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
I don't understand why would IsTopLevel() be always false, but then I don't understand why would we only want to call Refresh() when it's true, isn't the idea to refresh all the windows?
Although thinking more about it, we probably don't need to refresh the standard controls, i.e. those for which IsOfStandardClass() returns true, as those should already refresh themselves correctly — and if they don't, calling Refresh() on them is probably not going to help anyhow.
Also, it looks like in the case which motivated all this, i.e. switching between light and dark modes, we're going to refresh all the windows twice: first from HandleSysColorChange() and then from HandleSettingChange() itself. It's not the end of the world, but it would still be better to avoid this.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
but then I don't understand why would we only want to call
Refresh()when it's true, isn't the idea to refresh all the windows?
Refresh() documentation says it refreshes all children recursively.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
After experimenting changing between contrast and dark themes I find we only need to Refresh() upon WM_SETTINGCHANGE. Since Refresh() uses RDW_ALLCHILDREN, we only need to do the top level window.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@stevecor pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()