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 479867 16dc1c5944484914c6969ef78ac73161df69f150
parent 479866 768bf846fac5a0ccd56c77fe404e3dcc059035a5
child 479868 0d6d693fdcb6b1effad9210901f90a6cc8fc4311
push id44393
push userVYV03354@nifty.ne.jp
push dateTue, 07 Feb 2017 13:53:48 +0000
reviewersFelipe
bugs1336230
milestone54.0a1
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;