Bug 1478576 - Use nsBaseWidget::NotifyThemeChanged for dark/liehgt theme changes on Windows 10. r=mhowell
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 07 Aug 2018 11:56:22 +0900
changeset 487136 f74ba700aff02f4716ffb9ce1c07efcc9657fa12
parent 487135 e1392716e580fa5dcce0ceaf27b5d7d89cddd84a
child 487137 fb3e5d2dd1d7c918fab39b3ef32908928eb299ec
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1478576
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1478576 - Use nsBaseWidget::NotifyThemeChanged for dark/liehgt theme changes on Windows 10. r=mhowell Now nsBaseWidget::NotifyThemeChanged properly notifies to the pres shell. MozReview-Commit-ID: Kmd68ckHanl
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5320,21 +5320,18 @@ nsWindow::ProcessMessage(UINT msg, WPARA
         break;
       }
       if (lParam) {
         auto lParamString = reinterpret_cast<const wchar_t*>(lParam);
         if (!wcscmp(lParamString, L"ImmersiveColorSet")) {
           // This might be the Win10 dark mode setting; only way to tell
           // is to actually force a theme change, since we don't get
           // WM_THEMECHANGED or WM_SYSCOLORCHANGE when that happens.
-          if (IsWin10OrLater() && mWindowType == eWindowType_toplevel) {
-            nsIPresShell* presShell = mWidgetListener->GetPresShell();
-            if (presShell) {
-              presShell->ThemeChanged();
-            }
+          if (IsWin10OrLater()) {
+            NotifyThemeChanged();
           }
           // WM_SYSCOLORCHANGE is not dispatched for accent color changes
           OnSysColorChanged();
           break;
         }
         if (IsWin10OrLater() && mWindowType == eWindowType_invisible) {
           if (!wcscmp(lParamString, L"UserInteractionMode")) {
             nsCOMPtr<nsIWindowsUIUtils> uiUtils(do_GetService("@mozilla.org/windows-ui-utils;1"));