1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-11-15 21:35:01 -05:00

Don't fallback to FindWindow() when registering a window (winnt).

Gecko 27+ required for winnt. |nativeHandle| supported since 17.
This commit is contained in:
foudfou 2014-06-05 14:48:19 +02:00
parent 354a48d2fc
commit 93cabd4fa0

View File

@ -170,16 +170,12 @@ firetray.Handler.registerWindow = function(win) {
log.debug("register window");
let baseWin = firetray.Handler.getWindowInterface(win, "nsIBaseWindow");
let nativeHandle = baseWin.nativeHandle;
let hwnd, wid;
if (nativeHandle) {
hwnd = firetray.Win32.hexStrToHwnd(nativeHandle);
wid = nativeHandle;
}
else {
hwnd = user32.FindWindowW("MozillaWindowClass", win.document.title);
wid = firetray.Win32.hwndToHexStr(hwnd);
let wid = baseWin.nativeHandle;
if (!wid) {
log.error("nativeHandle undefined ?!");
return false;
}
let hwnd = firetray.Win32.hexStrToHwnd(wid);
log.debug("=== hwnd="+hwnd+" wid="+wid+" win.document.title: "+win.document.title);
if (this.windows.hasOwnProperty(wid)) {