Bug 1702741 - Click a notification should open msg window even minimized to tray. r=mkmelin

Differential Revision: https://phabricator.services.mozilla.com/D110910

--HG--
extra : amend_source : 5e548a97975936163888b681a418f8240cc615cf
This commit is contained in:
Ping Chen 2021-04-09 13:29:15 +03:00
Родитель 7a618847cf
Коммит 8a7261cd70
4 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -13,7 +13,7 @@ addEventListener("sizemodechange", () => {
var bw = docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow);
Cc["@mozilla.org/messenger/osintegration;1"]
.getService(Ci.nsIMessengerWindowsIntegration)
.HideWindow(bw);
.hideWindow(bw);
});
}
});

Просмотреть файл

@ -320,6 +320,12 @@ var MailUtils = {
let mail3PaneWindow = Services.wm.getMostRecentWindow("mail:3pane");
if (mail3PaneWindow) {
mail3PaneWindow.MsgDisplayMessageInFolderTab(aMsgHdr);
if (Ci.nsIMessengerWindowsIntegration) {
Cc["@mozilla.org/messenger/osintegration;1"]
.getService(Ci.nsIMessengerWindowsIntegration)
.showWindow(mail3PaneWindow);
}
mail3PaneWindow.focus();
} else {
let args = { msgHdr: aMsgHdr };
args.wrappedJSObject = args;

Просмотреть файл

@ -3,10 +3,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
interface mozIDOMWindowProxy;
#include "nsIBaseWindow.idl"
#include "nsIMessengerOSIntegration.idl"
[scriptable, uuid(e14eb9fe-e05e-4b78-bd31-5b7e1497f91b)]
interface nsIMessengerWindowsIntegration : nsIMessengerOSIntegration {
void HideWindow(in nsIBaseWindow aWindow);
void hideWindow(in nsIBaseWindow aWindow);
void showWindow(in mozIDOMWindowProxy aWindow);
};

Просмотреть файл

@ -185,6 +185,12 @@ nsresult nsMessengerWinIntegration::HideWindow(nsIBaseWindow* aWindow) {
return NS_OK;
}
NS_IMETHODIMP
nsMessengerWinIntegration::ShowWindow(mozIDOMWindowProxy* aWindow) {
activateWindow(aWindow);
return NS_OK;
}
NS_IMETHODIMP
nsMessengerWinIntegration::UpdateUnreadCount(uint32_t unreadCount,
const nsAString& unreadTooltip) {