Bug 503879, followup to move NS_SYSCOLORCHANGED code into a separate method
authorNeil Deakin <neil@mozilla.com>
Mon, 21 Nov 2011 12:53:20 -0500
changeset 80582 fa1aaea9b7e6fe5a47fc91fb03a6717faf5f1b30
parent 80581 7e2695c9d94e2f652122fd8374e62ae881373e49
child 80583 6f089d64ae6432f84835d6e57d6ad0aad8033b1b
push id21511
push userbmo@edmorley.co.uk
push dateTue, 22 Nov 2011 02:38:00 +0000
treeherdermozilla-central@b8955ff00aae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs503879
milestone11.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 503879, followup to move NS_SYSCOLORCHANGED code into a separate method
widget/src/windows/nsWindow.cpp
widget/src/windows/nsWindow.h
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -4663,27 +4663,17 @@ bool nsWindow::ProcessMessage(UINT msg, 
       result = true;
       break;
 
     case WM_DISPLAYCHANGE:
       DispatchStandardEvent(NS_DISPLAYCHANGED);
       break;
 
     case WM_SYSCOLORCHANGE:
-      if (mWindowType == eWindowType_invisible) {
-        ::EnumThreadWindows(GetCurrentThreadId(), nsWindow::BroadcastMsg, msg);
-      }
-      else {
-        // Note: This is sent for child windows as well as top-level windows.
-        // The Win32 toolkit normally only sends these events to top-level windows.
-        // But we cycle through all of the childwindows and send it to them as well
-        // so all presentations get notified properly.
-        // See nsWindow::GlobalMsgWindowProc.
-        DispatchStandardEvent(NS_SYSCOLORCHANGED);
-      }
+      OnSysColorChanged();
       break;
 
     case WM_NOTIFY:
       // TAB change
     {
       LPNMHDR pnmh = (LPNMHDR) lParam;
 
         switch (pnmh->code) {
@@ -7996,16 +7986,32 @@ nsWindow::HasBogusPopupsDropShadowOnMult
           }
         }
       }
     }
   }
   return !!sHasBogusPopupsDropShadowOnMultiMonitor;
 }
 
+void
+nsWindow::OnSysColorChanged()
+{
+  if (mWindowType == eWindowType_invisible) {
+    ::EnumThreadWindows(GetCurrentThreadId(), nsWindow::BroadcastMsg, WM_SYSCOLORCHANGE);
+  }
+  else {
+    // Note: This is sent for child windows as well as top-level windows.
+    // The Win32 toolkit normally only sends these events to top-level windows.
+    // But we cycle through all of the childwindows and send it to them as well
+    // so all presentations get notified properly.
+    // See nsWindow::GlobalMsgWindowProc.
+    DispatchStandardEvent(NS_SYSCOLORCHANGED);
+  }
+}
+
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: IME management and accessibility
  **
  ** Handles managing IME input and accessibility.
  **
  **************************************************************
--- a/widget/src/windows/nsWindow.h
+++ b/widget/src/windows/nsWindow.h
@@ -438,16 +438,17 @@ protected:
   static UINT             GetInternalMessage(UINT aNativeMessage);
   static UINT             GetNativeMessage(UINT aInternalMessage);
   void                    OnMouseWheel(UINT aMsg, WPARAM aWParam,
                                        LPARAM aLParam, LRESULT *aRetValue);
   void                    OnMouseWheelInternal(UINT aMessage, WPARAM aWParam,
                                                LPARAM aLParam,
                                                LRESULT *aRetValue);
   void                    OnWindowPosChanging(LPWINDOWPOS& info);
+  void                    OnSysColorChanged();
 
   /**
    * Function that registers when the user has been active (used for detecting
    * when the user is idle).
    */
   void                    UserActivity();
 
   PRInt32                 GetHeight(PRInt32 aProposedHeight);