Bug 1336230 - If the current window is maximized if the user opens a new window, skip the opening animation. r?felipe draft
authorMike Conley <mconley@mozilla.com>
Fri, 03 Feb 2017 16:11:44 -0500
changeset 470540 5ed841077b6e25d714067a3bacb8cf1dc81c7ccf
parent 470539 2114f193a2c7cfea8080484cea888aaffbbd205a
child 544514 ee10d447278082209e049ea1c406d66a661622de
push id44069
push usermconley@mozilla.com
push dateFri, 03 Feb 2017 22:51:00 +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
@@ -4114,16 +4114,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;