Bug 809254 - New Tab (⌘T) while minimized leaves the window minimized. r=dao
authorAndre Reinald <areinald@mozilla.com>
Tue, 26 Feb 2013 18:18:26 +0100
changeset 133438 f613612cb05c3cc8a09524797c689f428aac028b
parent 133437 cf2f3b45cb3837773293e38186de7b4cefe58b27
child 133439 6e195e29b4d6b35993e977a37658386b1fc8157d
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-beta@d4b152d29d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs809254
milestone22.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 809254 - New Tab (⌘T) while minimized leaves the window minimized. r=dao
browser/base/content/utilityOverlay.js
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -317,22 +317,23 @@ function openLinkIn(url, where, params) 
                        postData: aPostData,
                        inBackground: loadInBackground,
                        allowThirdPartyFixup: aAllowThirdPartyFixup,
                        relatedToCurrent: aRelatedToCurrent,
                        isUTF8: aIsUTF8});
     break;
   }
 
-  // If this window is active, focus the target window. Otherwise, focus the
-  // content but don't raise the window, since the URI we just loaded may have
-  // resulted in a new frontmost window (e.g. "javascript:window.open('');").
+  // If this window is active, or the user created a new tab, focus the target
+  // window. Otherwise, focus the content but don't raise the window, since the
+  // URI we just loaded may have resulted in a new frontmost window
+  // (e.g. "javascript:window.open('');").
   var fm = Components.classes["@mozilla.org/focus-manager;1"].
              getService(Components.interfaces.nsIFocusManager);
-  if (window == fm.activeWindow)
+  if (window == fm.activeWindow || isBlankPageURL(url))
     w.focus();
   w.gBrowser.selectedBrowser.focus();
 
   if (!loadInBackground && isBlankPageURL(url))
     w.focusAndSelectUrlBar();
 }
 
 // Used as an onclick handler for UI elements with link-like behavior.