1
0
mirror of https://github.com/moparisthebest/FireTray synced 2025-01-08 12:08:05 -05:00

Try to get the default icon from getMostRecentWindow/nativeHandle instead of

FindWindow/HiddenWindow.
This commit is contained in:
foudfou 2014-06-04 22:00:47 +02:00
parent 738c412c23
commit 659ca4bb80

View File

@ -85,10 +85,15 @@ firetray.StatusIcon = {
loadThemedIcons: function() { }, loadThemedIcons: function() { },
loadImages: function() { loadImages: function() {
// the Mozilla hidden window has the default Mozilla icon let topmost = firetray.Handler.getWindowInterface(
let hwnd_hidden_moz = user32.FindWindowW("MozillaHiddenWindowClass", null); Services.wm.getMostRecentWindow(null), "nsIBaseWindow");
log.debug("=== hwnd_hidden_moz="+hwnd_hidden_moz); let hwnd;
this.icons.insert('app', this.getIconFromWindow(hwnd_hidden_moz)); if (topmost.nativeHandle)
hwnd = firetray.Win32.hexStrToHwnd(topmost.nativeHandle);
else
hwnd = user32.FindWindowW("MozillaHiddenWindowClass", null);
log.debug("topmost or hiddenWin hwnd="+hwnd);
this.icons.insert('app', this.getIconFromWindow(hwnd));
['app_icon_custom', 'mail_icon_custom'].forEach(function(elt) { ['app_icon_custom', 'mail_icon_custom'].forEach(function(elt) {
firetray.StatusIcon.loadImageCustom(elt); firetray.StatusIcon.loadImageCustom(elt);
}); });