[Pkg-mozext-commits] [firetray] 69/84: Try to get the default icon from getMostRecentWindow/nativeHandle instead of FindWindow/HiddenWindow.

David Prévot taffit at moszumanska.debian.org
Sun Jul 20 01:42:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firetray.

commit 659ca4bb80c05b8c36df67f6bf4aa8c1a01fb1ea
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Wed Jun 4 22:00:47 2014 +0200

    Try to get the default icon from getMostRecentWindow/nativeHandle instead of
    FindWindow/HiddenWindow.
---
 src/modules/winnt/FiretrayStatusIcon.jsm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/modules/winnt/FiretrayStatusIcon.jsm b/src/modules/winnt/FiretrayStatusIcon.jsm
index b7681c2..3803d1b 100644
--- a/src/modules/winnt/FiretrayStatusIcon.jsm
+++ b/src/modules/winnt/FiretrayStatusIcon.jsm
@@ -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);
     });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git



More information about the Pkg-mozext-commits mailing list