actually mapped (or "mapped" to another desktop)
* check app started if -firetrayShowHide or -firetrayPresent
We can't base the app-started event solely on MapNotify, at least because the
app could be started on another desktop (not mapped). The app-started event in
Thunderbird is not based on mail-startup-done events. We might have to consider
implementing a watchdog for unexpected cases...
Unfortunately there is not equivalent "sessionstore-windows-restored" in TB
yet. Many events related to windows are issued before windows are fully
realized. "mail-startup-done"/"mail-tabs-session-restored" are issued by *each*
window. "console-api-log-event" is not reliable and can be issued at relatively
early stage on heavy configs. So that the best solution is probably to count
restored windows ourselves...
base startup event on "sessionstore-windows-restored" and
"console-api-log-event", instead of the first "before-first-paint", reverting
some of 29de64e5
No 'new-directed-incoming-message' event is issued on new messages for twitter
accounts, which seem to be considered chatrooms (instead of private
conversations).
* when start_hidden, hide window on first x11.MapNotify instead of hiding all
windows short after the "startup event".
This prevents having visibility falsely corrected for windows that are
displayed after the "startup event", and thus having to click twice on the
tray icon to actually restore windows.
That lets the windows get well realized before we can hide them
(start_hidden). This is especially true for heavy configurations with numerous
addons (Lightning with multiple remote calendars for instance).
* rename commande line flag '-showHide' to '-firetray-showHide'
* drop use of AddonLogging.jsm in variable F, and use log4moz instead
* do not remove String.prototype.trim
Regarding String.prototype.trim tough, it's unclear why its fallback definition
should be removed: MDN says it was introduced in JavaScript 1.8.1, but it seems
available in 1.7...
(sub)modules using ctypes libs just need to declare opened libs, which will be
ultimately closed by the Handler. Not only is this fancier, but also useful in
situations where we want to init()/shutdown() modules without closing libs used
by others (ex: IMStatusIcon)
"Too small window" bug with Lightning installed.
start_hidden is not so easy to achieve since:
- we can't rely on appStarted (window displayed in between)
- we can't rely on 'load' event (window not fully realized - position, size)
- we can't rely on 'resize' event (window displayed/shown/resized a variable
number of times)
Besides, nsIBaseWindow.visibility remains the surest way to hide windows at
startup.
Although we can re-construct a gdk.GdkWindow.ptr from natvieHandle (address of
the actual GdkWindow), we can't seem to be able to use it. For ex.,
gdk_window_get_user_data(), which should return a pointer to the corresponding
GtkWindow, returns strange adresses with our re-constructed pointer (0x11,
0x19, 0x0, ...)
...and despite the fact that both the "original" gdk.GdkWindow.ptr and the
re-constructed one do point to the same address, and that GDK_IS_WINDOW (macro
here wrapped into an embedded lib) is returning true for both pointers...