Skip to content

Commit 890dc57

Browse files
committed
Merge branch 'develop'
2 parents 2a82bf4 + f2028be commit 890dc57

File tree

10 files changed

+73
-28
lines changed

10 files changed

+73
-28
lines changed

Changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-- 0.6.5 - 15 Jan 2019
2+
3+
- Make foreground restore for Windows optional, just like Linux.
4+
(Settings->Windows->Activate restored windows)
5+
- Fix add-on for win64
6+
17
-- 0.6.4 - 13 Jan 2019
28

39
- Added left click action for libindicator icon (Thank you for the tip @PlagueCZ)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ New releases have been tested with:
55

66
Working:
77

8-
Windows 10 x64, Thunderbird win32 52.9.1 and 60.0
9-
openSuSE Leap 15.0, KDE, Thunderbird 52.9.1 and 60.0
8+
Windows 10 x64, Thunderbird win32 52.9.1 and 60.4.0
9+
Windows 10 x64, Thunderbird win64 52.9.1 and 60.4.0
10+
openSuSE Leap 15.0, KDE, Thunderbird 52.9.1 and 60.3.0
1011

1112
Linux Mint 18.3 Sylvia
1213
Linux Mint 19 Tara and Thunderbird 60.2.1
@@ -19,7 +20,6 @@ Thank you for testing !!!
1920

2021
Not working:
2122

22-
Windows 10 x64, Thunderbird win64 60.* (icon visibible but no menu, no show/hide on click)
2323
(K)ubuntu 16.04, Thunderbird (very small icon with GTK)
2424

2525

src/chrome/content/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var firetrayUIOptions = {
3434
this.initAppIconType();
3535
if (firetray.Handler.support['winnt']) {
3636
this.hideUnsupportedOptions([
37-
'ui_show_activates', 'ui_remember_desktop', 'ui_use_appindicator_icon', 'app_icon_default',
37+
'ui_remember_desktop', 'ui_use_appindicator_icon', 'app_icon_default',
3838
'ui_show_icon_on_hide', 'ui_scroll_hides', 'ui_radiogroup_scroll',
3939
'ui_scroll_hides', 'ui_middle_click', 'newmail_icon_names'
4040
]);

src/defaults/preferences/prefs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pref("extensions.firetray.hides_on_minimize", true);
99
pref("extensions.firetray.hides_single_window", true);
1010
pref("extensions.firetray.hides_last_only", false);
1111
pref("extensions.firetray.start_hidden", false);
12-
pref("extensions.firetray.show_activates", false);
12+
pref("extensions.firetray.show_activates", true);
1313
pref("extensions.firetray.remember_desktop", false);
1414

1515
pref("extensions.firetray.app_icon_type", 0);
@@ -39,7 +39,7 @@ pref("extensions.firetray.folder_count_recursive", true);
3939
// Ci.nsMsgFolderFlags.Archive|Drafts|Junk|Queue|SentMail|Trash|Virtual
4040
pref("extensions.firetray.excluded_folders_flags", 1077956384);
4141
// exposed in 1 tree, hence 2 branches: serverTypes, excludedAccounts
42-
pref("extensions.firetray.mail_accounts", '{ "serverTypes": {"pop3":{"order":1,"excluded":false}, "imap":{"order":1,"excluded":false}, "movemail":{"order":2,"excluded":true}, "none":{"order":3,"excluded":false}, "rss":{"order":4,"excluded":true}, "nntp":{"order":5,"excluded":true}, "exquilla":{"order":6,"excluded":true}}, "excludedAccounts": [] }'); // JSON
42+
pref("extensions.firetray.mail_accounts", '{ "serverTypes": {"pop3":{"order":1,"excluded":false}, "imap":{"order":1,"excluded":false}, "movemail":{"order":2,"excluded":true}, "none":{"order":3,"excluded":false}, "rss":{"order":4,"excluded":true}, "nntp":{"order":5,"excluded":true}, "exquilla":{"order":6,"excluded":false}}, "excludedAccounts": [] }'); // JSON
4343
pref("extensions.firetray.only_favorite_folders", false);
4444

4545
pref("extensions.firetray.with_appindicator", true);

src/install.rdf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<em:multiprocessCompatible>true</em:multiprocessCompatible>
88
<em:type>2</em:type>
99
<em:name>FireTray</em:name>
10-
<em:version>0.6.4</em:version> <!-- change FIRETRAY_VERSION accordingly ! -->
10+
<em:version>0.6.5</em:version> <!-- change FIRETRAY_VERSION accordingly ! -->
1111
<em:creator>Hua Luo, Francesco Solero, Foudil BRÉTEL</em:creator>
1212
<em:contributor>Hua Luo, Francesco Solero (Firetray original authors)</em:contributor>
1313
<em:homepageURL>https://github.com/Ximi1970/FireTray</em:homepageURL>

src/modules/commons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Cu = Components.utils;
2525
Cu.import("resource://gre/modules/Services.jsm");
2626
Cu.import("resource://firetray/logging.jsm");
2727

28-
const FIRETRAY_VERSION = "0.6.4"; // needed for sync call of onVersionChange() :(
28+
const FIRETRAY_VERSION = "0.6.5"; // needed for sync call of onVersionChange() :(
2929
const FIRETRAY_OS_SUPPORT = ['freebsd', 'linux', 'winnt']; // install.rdf sync :(
3030
const FIRETRAY_ID = "{9533f794-00b4-4354-aa15-c2bbda6989f8}";
3131
const FIRETRAY_PREF_BRANCH = "extensions.firetray.";

src/modules/ctypes/winnt/user32.jsm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ function user32_defines(lib) {
7575
lib.lazy_bind("SetWindowLongW", win32.LONG_PTR , win32.HWND, ctypes.int, win32.LONG_PTR);
7676
// SetWindowLongPtrW aliases SetWindowLongW with the correct signature thank
7777
// win32.LONG_PTR
78+
//
79+
// x86_64 needs GetWindowLongPtrW instead of SetWindowLongW
80+
lib.lazy_bind("GetWindowLongPtrW", win32.LONG_PTR, win32.HWND, ctypes.int);
81+
lib.lazy_bind("SetWindowLongPtrW", win32.LONG_PTR, win32.HWND, ctypes.int, win32.LONG_PTR);
7882
this.GWLP_WNDPROC = -4;
7983
this.GWLP_HINSTANCE = -6;
8084
this.GWLP_ID = -12;
@@ -99,6 +103,9 @@ function user32_defines(lib) {
99103
lib.lazy_bind("CallWindowProcW", win32.LRESULT, this.WNDPROC, win32.HWND, win32.UINT, win32.WPARAM, win32.LPARAM);
100104
lib.lazy_bind("DefWindowProcW", win32.LRESULT, win32.HWND, win32.UINT, win32.WPARAM, win32.LPARAM);
101105

106+
lib.lazy_bind("CallWindowProc", win32.LRESULT, this.WNDPROC, win32.HWND, win32.UINT, win32.WPARAM, win32.LPARAM);
107+
lib.lazy_bind("DefWindowProc", win32.LRESULT, win32.HWND, win32.UINT, win32.WPARAM, win32.LPARAM);
108+
102109
this.WNDCLASSEXW = ctypes.StructType("WNDCLASSEXW", [
103110
{ "cbSize": win32.UINT },
104111
{ "style": win32.UINT },

src/modules/winnt/FiretrayPopupMenu.jsm

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,27 @@ firetray.PopupMenu = {
144144
return;
145145
}
146146

147-
switch (itemId) {
148-
case IDM_PREF: firetray.Handler.openPrefWindow(); break;
149-
case IDM_QUIT: firetray.Handler.quitApplication(); break;
150-
case IDM_NEW_MSG: firetray.Handler.openMailMessage(); break;
151-
case IDM_NEW_WND: firetray.Handler.openBrowserWindow(); break;
152-
case IDM_RESET: firetray.Handler.setIconImageDefault(); break;
147+
switch (win32.LOWORD(itemId)) {
148+
case IDM_PREF:
149+
log.debug("IDM_PREF");
150+
firetray.Handler.openPrefWindow();
151+
break;
152+
case IDM_QUIT:
153+
log.debug("IDM_QUIT");
154+
firetray.Handler.quitApplication();
155+
break;
156+
case IDM_NEW_MSG:
157+
log.debug("IDM_NEW_MSG");
158+
firetray.Handler.openMailMessage();
159+
break;
160+
case IDM_NEW_WND:
161+
log.debug("IDM_NEW_WND");
162+
firetray.Handler.openBrowserWindow();
163+
break;
164+
case IDM_RESET:
165+
log.debug("IDM_RESET");
166+
firetray.Handler.setIconImageDefault();
167+
break;
153168
default:
154169
log.error("no action for itemId ("+itemId+")");
155170
}

src/modules/winnt/FiretrayStatusIcon.jsm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,14 @@ firetray.StatusIcon = {
221221
log.debug("CreateWindow="+!hwnd_hidden.isNull()+" winLastError="+ctypes.winLastError);
222222

223223
this.callbacks.proxyWndProc = user32.WNDPROC(firetray.StatusIcon.proxyWndProc);
224-
let procPrev = user32.SetWindowLongW(hwnd_hidden, user32.GWLP_WNDPROC,
225-
ctypes.cast(this.callbacks.proxyWndProc, win32.LONG_PTR));
224+
let procPrev;
225+
if (firetray.Handler.app.ABI == "x86_64-msvc") {
226+
procPrev = user32.SetWindowLongPtrW(hwnd_hidden, user32.GWLP_WNDPROC,
227+
ctypes.cast(this.callbacks.proxyWndProc, win32.LONG_PTR));
228+
} else {
229+
procPrev = user32.SetWindowLongW(hwnd_hidden, user32.GWLP_WNDPROC,
230+
ctypes.cast(this.callbacks.proxyWndProc, win32.LONG_PTR));
231+
}
226232
log.debug("procPrev="+procPrev+" winLastError="+ctypes.winLastError);
227233

228234
firetray.Win32.acceptAllMessages(hwnd_hidden);
@@ -241,7 +247,7 @@ firetray.StatusIcon = {
241247
},
242248

243249
proxyWndProc: function(hWnd, uMsg, wParam, lParam) {
244-
// log.debug("ProxyWindowProc CALLED: hWnd="+hWnd+", uMsg="+uMsg+", wParam="+wParam+", lParam="+lParam);
250+
log.debug("ProxyWindowProc CALLED: hWnd="+hWnd+", uMsg="+uMsg+", wParam="+wParam+", lParam="+lParam);
245251

246252
// FIXME: WM_TASKBARCREATED is needed in case of explorer crash
247253
// http://twigstechtips.blogspot.fr/2011/02/c-detect-when-windows-explorer-has.html

src/modules/winnt/FiretrayWindow.jsm

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ firetray.Window.shutdown = function() {
4343

4444
firetray.Window.getVisibility = function(wid) {
4545
let hwnd = firetray.Win32.hexStrToHwnd(wid);
46-
let style = user32.GetWindowLongW(hwnd, user32.GWL_STYLE);
46+
let style;
47+
if (firetray.Handler.app.ABI == "x86_64-msvc") {
48+
style = user32.GetWindowLongPtrW(hwnd, user32.GWL_STYLE);
49+
} else {
50+
style = user32.GetWindowLongW(hwnd, user32.GWL_STYLE);
51+
}
4752
return ((style & user32.WS_VISIBLE) != 0); // user32.IsWindowVisible(hwnd);
4853
};
4954

@@ -57,7 +62,8 @@ firetray.Window.setVisibility = function(wid, visible) {
5762
visible = true;
5863
}
5964
let ret = user32.ShowWindow(hwnd, visible ? user32.SW_SHOW : user32.SW_HIDE);
60-
if (visible) user32.SetForegroundWindow(hwnd);
65+
if (firetray.Utils.prefService.getBoolPref('show_activates'))
66+
if (visible) user32.SetForegroundWindow(hwnd);
6167
log.debug(" ShowWindow="+ret+" winLastError="+ctypes.winLastError);
6268
return visible;
6369
};
@@ -138,21 +144,21 @@ firetray.Window.wndProcStartup = function(hWnd, uMsg, wParam, lParam) {
138144
return user32.CallWindowProcW(user32.WNDPROC(procPrev), hWnd, uMsg, wParam, lParam);
139145
};
140146

141-
// https://social.msdn.microsoft.com/Forums/en-US/4eb3bad0-caf3-45ca-bfe8-7bc257af986a/getwindowlongsetwindowlong-on-gwlwndproc-crashes-in-compact-2013?forum=winembmngdapp
142-
var procNat = null;
143-
firetray.Window.NativeWndProc = function(hWnd, uMsg, wParam, lParam) {
144-
return user32.CallWindowProcW(user32.WNDPROC(procNat), hWnd, uMsg, wParam, lParam);
145-
}
146-
147147
// procInfo = {wid, hwnd, jsProc, mapNew, mapBak}
148+
var procDummy = null;
148149
firetray.Window.attachWndProc = function(procInfo) {
149150
try {
150151
let wndProc = ctypes.cast(user32.WNDPROC(procInfo.jsProc), win32.LONG_PTR);
151152
log.debug("proc="+wndProc);
152153
procInfo.mapNew.insert(procInfo.wid, wndProc);
153154
// let procPrev = user32.SetWindowLongW(procInfo.hwnd, user32.GWLP_WNDPROC, wndProc);
154-
this.procNat = wndProc;
155-
let procPrev = user32.SetWindowLongW(procInfo.hwnd, user32.GWLP_WNDPROC, this.procNat);
155+
this.procDummy = wndProc;
156+
let procPrev;
157+
if (firetray.Handler.app.ABI == "x86_64-msvc") {
158+
procPrev = user32.SetWindowLongPtrW(procInfo.hwnd, user32.GWLP_WNDPROC, wndProc);
159+
} else {
160+
procPrev = user32.SetWindowLongW(procInfo.hwnd, user32.GWLP_WNDPROC, wndProc);
161+
}
156162
log.debug("procPrev="+procPrev+" winLastError="+ctypes.winLastError);
157163
/* we can't store WNDPROC callbacks (JS ctypes objects) with SetPropW(), as
158164
we need long-living refs. */
@@ -179,7 +185,12 @@ firetray.Window.detachWndProc = function(procInfo) {
179185
let procNew = procInfo.mapNew.get(wid);
180186
let hwnd = firetray.Win32.hexStrToHwnd(wid);
181187
log.debug("hwnd="+hwnd);
182-
let procPrev = user32.SetWindowLongW(hwnd, user32.GWLP_WNDPROC, procBak);
188+
let procPrev;
189+
if (firetray.Handler.app.ABI == "x86_64-msvc") {
190+
procPrev = user32.SetWindowLongPtrW(hwnd, user32.GWLP_WNDPROC, procBak);
191+
} else {
192+
procPrev = user32.SetWindowLongW(hwnd, user32.GWLP_WNDPROC, procBak);
193+
}
183194
firetray.js.assert(firetray.js.strEquals(procPrev, procNew),
184195
"Wrong WndProc replaced.");
185196
procInfo.mapNew.remove(wid);

0 commit comments

Comments
 (0)