Bug 1218875 - Fix the error in nsMessengerWinIntegration.cpp. r=jcranmer a=bustage fix on CLOSED TREE
authorRichard Marti <richard.marti@gmail.com>
Tue, 27 Oct 2015 20:19:44 +0100
changeset 18514 547e6754480eb5a30af54258dca1226972230858
parent 18513 e0033c7a85976a17355ecae6988c71a94942ab52
child 18515 5d79bfdedcc534d6d1a1da41b97ed3d1f55b4cce
push id11331
push useraleth@instantbird.org
push dateTue, 27 Oct 2015 19:31:24 +0000
treeherdercomm-central@547e6754480e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcranmer, bustage
bugs1218875
Bug 1218875 - Fix the error in nsMessengerWinIntegration.cpp. r=jcranmer a=bustage fix on CLOSED TREE Fix is from Ratty on IRC.
mailnews/base/src/nsMessengerWinIntegration.cpp
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -118,18 +118,21 @@ static void activateWindow( nsIDOMWindow
   HWND hwnd = hwndForDOMWindow( win );
   if ( hwnd )
   {
     // Restore the window if it is minimized.
     if ( ::IsIconic( hwnd ) )
       ::ShowWindow( hwnd, SW_RESTORE );
     // Use the OS call, if possible.
     ::SetForegroundWindow( hwnd );
-  } else // Use internal method.
-    win->Focus();
+  } else {
+    // Use internal method.
+    nsCOMPtr<nsPIDOMWindow> privateWindow(do_QueryInterface(win));
+    privateWindow->Focus();
+  }
 }
 // end shameless copying from nsNativeAppWinSupport.cpp
 
 static void openMailWindow(const nsACString& aFolderUri)
 {
   nsresult rv;
   nsCOMPtr<nsIMsgMailSession> mailSession ( do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv));
   if (NS_FAILED(rv))
@@ -482,17 +485,17 @@ nsresult nsMessengerWinIntegration::Show
 
   bool showAlert = true;
 
   if (prefBranch)
     prefBranch->GetBoolPref(SHOW_ALERT_PREF, &showAlert);
 
   // check if we are allowed to show a notification
   if (showAlert && mSHQueryUserNotificationState) {
-    MOZ_QUERY_USER_NOTIFICATION_STATE qstate;    
+    MOZ_QUERY_USER_NOTIFICATION_STATE qstate;
     if (SUCCEEDED(mSHQueryUserNotificationState(&qstate))) {
       if (qstate != QUNS_ACCEPTS_NOTIFICATIONS) {
         showAlert = false;
       }
     }
   }
 
   if (showAlert)