Bug 954451 - Quit warning is hidden when conversation window lacks focus, r=clokep.
authoraleth <aleth@instantbird.org>
Wed, 25 Jan 2012 23:49:52 +0100
changeset 18521 36621ac71303f0c9eddf487d10419621baa38fde
parent 18520 a2a44dff8a5ff8e713da001888ace6f1128ed3ee
child 18522 2e22f35a357569ba24f3109c8d6726b5218e3925
push id1103
push usermbanner@mozilla.com
push dateTue, 18 Mar 2014 07:44:06 +0000
treeherdercomm-beta@50c6279a0af0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersclokep
bugs954451
Bug 954451 - Quit warning is hidden when conversation window lacks focus, r=clokep.
im/modules/ibCore.jsm
--- a/im/modules/ibCore.jsm
+++ b/im/modules/ibCore.jsm
@@ -269,18 +269,21 @@ var Core = {
     promptMessage = PluralForm.get(unreadConvsCount, promptMessage)
                               .replace("#1", unreadConvsCount);
 
     let prompts = Services.prompt;
     let flags = prompts.BUTTON_TITLE_IS_STRING * prompts.BUTTON_POS_0 +
                 prompts.BUTTON_TITLE_CANCEL * prompts.BUTTON_POS_1 +
                 prompts.BUTTON_POS_1_DEFAULT;
     let checkbox = {value: false};
-    let convWindow = Services.wm.getMostRecentWindow("Messenger:convs");
-    if (prompts.confirmEx(convWindow, promptTitle, promptMessage, flags,
+    let parentWindow = Services.wm.getMostRecentWindow("Messenger:convs") ||
+                       Services.wm.getMostRecentWindow("Messenger:blist");
+    if (parentWindow)
+      parentWindow.focus();
+    if (prompts.confirmEx(parentWindow, promptTitle, promptMessage, flags,
                           button, null, null, promptCheckbox, checkbox)) {
       aCancelQuit.data = true;
       return;
     }
 
     if (checkbox.value)
       Services.prefs.setBoolPref("messenger.warnOnQuit", false);
   },