diff --git a/mozilla/toolkit/content/widgets/richlistbox.xml b/mozilla/toolkit/content/widgets/richlistbox.xml index 7bcc321723c..b45757d94e2 100644 --- a/mozilla/toolkit/content/widgets/richlistbox.xml +++ b/mozilla/toolkit/content/widgets/richlistbox.xml @@ -384,11 +384,6 @@ if (this.selType != "multiple" && this.selectedCount == 0) this.selectedItem = this.currentItem; - - // XXX hack for the Downloads manager (better to focus the list than - // the individual items - these usually aren't tabbable anyway, and - // we need the keyboard focus for navigation), see bug 363271: - this.focus(); ]]> diff --git a/mozilla/toolkit/mozapps/downloads/content/downloads.js b/mozilla/toolkit/mozapps/downloads/content/downloads.js index c1c63dc84c6..b58cb639973 100644 --- a/mozilla/toolkit/mozapps/downloads/content/downloads.js +++ b/mozilla/toolkit/mozapps/downloads/content/downloads.js @@ -173,9 +173,13 @@ function autoRemoveAndClose(aDownload) var autoClose = pref.getBoolPref(PREF_BDM_CLOSEWHENDONE); if (autoClose && (!window.opener || window.opener.location.href == window.location.href) && - gCanAutoClose && !gUserInteracted) + gCanAutoClose && !gUserInteracted) { gCloseDownloadManager(); + return true; + } } + + return false; } // This function can be overwritten by extensions that wish to place the Download Window in @@ -571,7 +575,8 @@ function Startup() gDownloadsView.controllers.appendController(gDownloadViewController); // downloads can finish before Startup() does, so check if the window should close - autoRemoveAndClose(); + if (!autoRemoveAndClose()) + gDownloadsView.focus(); } function Shutdown()