diff --git a/mozilla/modules/libpref/src/init/all.js b/mozilla/modules/libpref/src/init/all.js index 1a25f468394..9e13c754f3d 100644 --- a/mozilla/modules/libpref/src/init/all.js +++ b/mozilla/modules/libpref/src/init/all.js @@ -92,6 +92,7 @@ pref("browser.custom_text_color", false); pref("browser.use_document_colors", true); pref("browser.ldapfile_location", ""); pref("browser.print_background", false); +pref("browser.prefs_window.modeless", false); pref("browser.prefs_window_rect", "-1,-1,-1,-1"); pref("browser.find_window_rect", "-1,-1,-1,-1"); pref("browser.bookmark_window_rect", "-1,-1,-1,-1"); diff --git a/mozilla/xpfe/components/prefwindow/src/nsPrefWindow.cpp b/mozilla/xpfe/components/prefwindow/src/nsPrefWindow.cpp index 790cd072b7c..ab0fa271b25 100644 --- a/mozilla/xpfe/components/prefwindow/src/nsPrefWindow.cpp +++ b/mozilla/xpfe/components/prefwindow/src/nsPrefWindow.cpp @@ -215,19 +215,27 @@ NS_IMETHODIMP nsPrefWindow::ShowWindow( DOMWindowToWebShellWindow(currentFrontWin, &parent); -#if defined(MODELESS_PREF_DIALOG)||defined(DEBUG_mcafee)||defined(DEBUG_akkana)||defined(DEBUG_pavlov) - // testing modeless pref window. -mcafee - nsIWebShellWindow *foo = nsnull; - // pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size) - rv = appShell->CreateTopLevelWindow(parent, urlObj, PR_TRUE, PR_TRUE, - NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG, - cb, 0, 0, &foo); -#else - // pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size) - rv = appShell->RunModalDialog(nsnull, parent, urlObj, - NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG, - cb, 0, 0); -#endif + static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID); + NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &rv); + PRBool modelessPrefWindow = PR_FALSE; + if(NS_SUCCEEDED(rv)) + prefs->GetBoolPref("browser.prefs_window.modeless", &modelessPrefWindow); + else + ; // Assume false. + + if(modelessPrefWindow) { + nsIWebShellWindow *foo = nsnull; + // pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size) + rv = appShell->CreateTopLevelWindow(parent, urlObj, PR_TRUE, PR_TRUE, + NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG, + cb, 0, 0, &foo); + } else { + // pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size) + rv = appShell->RunModalDialog(nsnull, parent, urlObj, + NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG, + cb, 0, 0); + } + return rv; } // nsPrefWindow::ShowWindow()