Bug 1218875 - Fix the error in nsMessengerWinIntegration.cpp. r=jcranmer a=bustage fix on CLOSED TREE
Fix is from Ratty on IRC.
--- 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)