1
0
mirror of https://github.com/moparisthebest/FireTray synced 2025-01-06 11:08:04 -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() { },
loadImages: function() {
// the Mozilla hidden window has the default Mozilla icon
let hwnd_hidden_moz = user32.FindWindowW("MozillaHiddenWindowClass", null);
log.debug("=== hwnd_hidden_moz="+hwnd_hidden_moz);
this.icons.insert('app', this.getIconFromWindow(hwnd_hidden_moz));
let topmost = firetray.Handler.getWindowInterface(
Services.wm.getMostRecentWindow(null), "nsIBaseWindow");
let hwnd;
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) {
firetray.StatusIcon.loadImageCustom(elt);
});