Bug 1184201 - Disable fullscreen transition on Windows if composition is disabled. r=jimm, a=sledru
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 10 Aug 2015 23:20:03 +1000
changeset 288752 881a6fc93a030135780e7c62421afa25dcf08c78
parent 288751 6b8ab5760fa7b92af3ca44a6bbc99da5d4e1ecd8
child 288753 f20639a7ee401f16bc5806db8a500c23f19bfd2e
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, sledru
bugs1184201
milestone42.0a2
Bug 1184201 - Disable fullscreen transition on Windows if composition is disabled. r=jimm, a=sledru
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -2986,16 +2986,23 @@ private:
   }
 };
 
 NS_IMPL_ISUPPORTS0(FullscreenTransitionData)
 
 /* virtual */ bool
 nsWindow::PrepareForFullscreenTransition(nsISupports** aData)
 {
+  // We don't support fullscreen transition when composition is not
+  // enabled, which could make the transition broken and annoying.
+  // See bug 1184201.
+  if (!nsUXThemeData::CheckForCompositor()) {
+    return false;
+  }
+
   FullscreenTransitionInitData initData;
   nsCOMPtr<nsIScreen> screen = GetWidgetScreen();
   int32_t x, y, width, height;
   screen->GetRectDisplayPix(&x, &y, &width, &height);
   MOZ_ASSERT(BoundsUseDisplayPixels(),
              "Should only be called on top-level window");
   CSSToLayoutDeviceScale scale = GetDefaultScale();
   initData.mBounds.x = NSToIntRound(x * scale.scale);