diff --git a/toolkit/components/downloads/src/nsDownloadManager.cpp b/toolkit/components/downloads/src/nsDownloadManager.cpp index 43b73751bf76..ffca564ec3bb 100644 --- a/toolkit/components/downloads/src/nsDownloadManager.cpp +++ b/toolkit/components/downloads/src/nsDownloadManager.cpp @@ -1093,6 +1093,8 @@ nsDownloadManager::Open(nsIDOMWindow* aParent, const PRUnichar* aPath) if (pref) pref->GetIntPref(PREF_BDM_OPENDELAY, &delay); + params->AppendElement((void*)&delay); + // 3). Look for an existing Download Manager window, if we find one we just // tell it that a new download has begun (we don't focus, that's // annoying), otherwise we need to open the window. We do this on a timer @@ -1110,13 +1112,14 @@ nsDownloadManager::OpenTimerCallback(nsITimer* aTimer, void* aClosure) nsVoidArray* params = (nsVoidArray*)aClosure; nsIDOMWindow* parent = (nsIDOMWindow*)params->ElementAt(0); nsDownload* download = (nsDownload*)params->ElementAt(1); + PRInt32 openDelay = *(PRInt32*)params->ElementAt(2); PRInt32 complete; download->GetPercentComplete(&complete); // We only show the download window if the download is taking more than a non-tiny // amount of time to complete. - if (complete < 100) { + if (!openDelay || complete < 100) { PRBool focusDM = PR_FALSE; PRBool showDM = PR_TRUE; PRInt32 flashCount = -1;