Bug 960692 - Remove WM_PAINT handling in winrt widget. f=bas, r=bbondy, a=sledru
authorJim Mathies <jmathies@mozilla.com>
Mon, 03 Mar 2014 12:18:50 -0600
changeset 183187 5957105939810a4bd5b219dbfd3d07b2d64e898b
parent 183186 e8883bce299f66be0374f0e072afd91cbfa50b82
child 183188 a18745c1f289a2010a589285b2eec6cde1f0217b
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy, sledru
bugs960692
milestone29.0a2
Bug 960692 - Remove WM_PAINT handling in winrt widget. f=bas, r=bbondy, a=sledru
widget/windows/winrt/FrameworkView.cpp
widget/windows/winrt/MetroWidget.cpp
--- a/widget/windows/winrt/FrameworkView.cpp
+++ b/widget/windows/winrt/FrameworkView.cpp
@@ -361,17 +361,19 @@ FrameworkView::SetWidget(MetroWidget* aW
 void
 FrameworkView::SendActivationEvent() 
 {
   if (mShuttingDown) {
     return;
   }
   NS_ASSERTION(mWindow, "SetWindow must be called before SendActivationEvent!");
   mWidget->Activated(mWinActiveState);
-  UpdateWidgetSizeAndPosition();
+  if (mWinActiveState) {
+    UpdateWidgetSizeAndPosition();
+  }
   EnsureAutomationProviderCreated();
 }
 
 HRESULT
 FrameworkView::OnWindowVisibilityChanged(ICoreWindow* aWindow,
                                          IVisibilityChangedEventArgs* aArgs)
 {
   // If we're visible, or we can't determine if we're visible, just store
--- a/widget/windows/winrt/MetroWidget.cpp
+++ b/widget/windows/winrt/MetroWidget.cpp
@@ -792,28 +792,16 @@ MetroWidget::WindowProcedure(HWND aWnd, 
   }
 
   nsTextStore::ProcessMessage(this, aMsg, aWParam, aLParam, msgResult);
   if (msgResult.mConsumed) {
     return processResult;
   }
 
   switch (aMsg) {
-    case WM_PAINT:
-    {
-      HRGN rgn = CreateRectRgn(0, 0, 0, 0);
-      GetUpdateRgn(mWnd, rgn, false);
-      nsIntRegion region = WinUtils::ConvertHRGNToRegion(rgn);
-      DeleteObject(rgn);
-      if (region.IsEmpty())
-        break;
-      Paint(region);
-      break;
-    }
-
     case WM_POWERBROADCAST:
     {
       switch (aWParam)
       {
         case PBT_APMSUSPEND:
           MetroApp::PostSleepWakeNotification(true);
           break;
         case PBT_APMRESUMEAUTOMATIC: