Bug 1336230 - If the current window is maximized if the user opens a new window, skip the opening animation. r=Felipe
authorMike Conley <mconley@mozilla.com>
Fri, 03 Feb 2017 16:11:44 -0500
changeset 341085 16dc1c5944484914c6969ef78ac73161df69f150
parent 341084 768bf846fac5a0ccd56c77fe404e3dcc059035a5
child 341086 0d6d693fdcb6b1effad9210901f90a6cc8fc4311
push id86634
push usercbook@mozilla.com
push dateTue, 07 Feb 2017 13:14:58 +0000
treeherdermozilla-inbound@9dbd2d9b334e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1336230
milestone54.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 1336230 - If the current window is maximized if the user opens a new window, skip the opening animation. r=Felipe MozReview-Commit-ID: JHmG9nclcGC
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4116,16 +4116,23 @@ function OpenBrowserWindow(options) {
   }
 
   if (options && options.remote) {
     extraFeatures += ",remote";
   } else if (options && options.remote === false) {
     extraFeatures += ",non-remote";
   }
 
+  // If the window is maximized, we want to skip the animation, since we're
+  // going to be taking up most of the screen anyways, and we want to optimize
+  // for showing the user a useful window as soon as possible.
+  if (window.windowState == window.STATE_MAXIMIZED) {
+    extraFeatures += ",suppressanimation";
+  }
+
   // if and only if the current window is a browser window and it has a document with a character
   // set, then extract the current charset menu setting from the current document and use it to
   // initialize the new browser window...
   var win;
   if (window && (wintype == "navigator:browser") && window.content && window.content.document) {
     var DocCharset = window.content.document.characterSet;
     charsetArg = "charset=" + DocCharset;