From 9d08cfe62104e40cfa9a0289082b57b5383fbacd Mon Sep 17 00:00:00 2001 From: "kyle.yuan%sun.com" Date: Sat, 29 Jul 2006 05:43:12 +0000 Subject: [PATCH] Bug 243807 profile manager hangs other dialogs' action r=neil, sr=jst, patch by neo.liu@sun.com --- suite/common/tasksOverlay.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/suite/common/tasksOverlay.js b/suite/common/tasksOverlay.js index 03f0bcd43cff..7d39cd1eff40 100644 --- a/suite/common/tasksOverlay.js +++ b/suite/common/tasksOverlay.js @@ -224,19 +224,22 @@ function checkFocusedWindow() function toProfileManager() { - var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] - .getService(Components.interfaces.nsIWindowWatcher); - var params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"] + const wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var promgrWin = wm.getMostRecentWindow( "mozilla:profileSelection" ); + if (promgrWin) { + promgrWin.focus(); + } else { + var params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"] .createInstance(Components.interfaces.nsIDialogParamBlock); - params.SetNumberStrings(1); - params.SetString(0, "menu"); - ww.openWindow(null, // no parent - "chrome://communicator/content/profile/profileSelection.xul", - null, - "centerscreen,chrome,modal,titlebar", + params.SetNumberStrings(1); + params.SetString(0, "menu"); + window.openDialog("chrome://communicator/content/profile/profileSelection.xul", + "", + "centerscreen,chrome,titlebar", params); - + } // Here, we don't care about the result code // that was returned in the param block. }