bug 628917 - avoid rebuilding the font list repeatedly, by only handling WM_FONTCHANGE for the hidden window. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Fri, 21 Dec 2012 09:49:28 +0000
changeset 125861 eb92322700ca68bc43376b7cdb344cc36c678aa0
parent 125860 67e4065cc26c30ad764f75c6706d1abdff9f4e4b
child 125862 f74a7c3f78f28d669ab3465a34a854ed4a3aac3b
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs628917
milestone20.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 628917 - avoid rebuilding the font list repeatedly, by only handling WM_FONTCHANGE for the hidden window. r=jdaggett
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -4573,16 +4573,23 @@ bool nsWindow::ProcessMessage(UINT msg, 
       // Invalidate the window so that the repaint will
       // pick up the new theme.
       Invalidate(true, true, true);
     }
     break;
 
     case WM_FONTCHANGE:
     {
+      // We only handle this message for the hidden window,
+      // as we only need to update the (global) font list once
+      // for any given change, not once per window!
+      if (mWindowType != eWindowType_invisible) {
+        break;
+      }
+
       nsresult rv;
       bool didChange = false;
 
       // update the global font list
       nsCOMPtr<nsIFontEnumerator> fontEnum = do_GetService("@mozilla.org/gfx/fontenumerator;1", &rv);
       if (NS_SUCCEEDED(rv)) {
         fontEnum->UpdateFontList(&didChange);
         ForceFontUpdate();