* revert to using setVisibility() instead of baseWin.visibility=false on

* startupHide cleaning

It looks like setting baseWin.visibility=false removes the possibility to
restore the app by calling it from the command line. This is why we use
setVisibility() instead if start_hidden.
This commit is contained in:
foudfou 2013-10-07 21:44:34 +02:00
parent ef30cd16e2
commit 6459bc6e4f
4 changed files with 18 additions and 8 deletions

View File

@ -74,8 +74,7 @@
<!ENTITY folder_count_recursive.accesskey "D">
<!ENTITY only_favorite_folders.label "Len obľúbené zložky">
<!ENTITY only_favorite_folders.accesskey "O">
<!ENTITY only_favorite_folders.tooltip
"V zahrnutých typoch zložiek a zahrnutých účtoch, počítať len správy v obľúbených zložkách">
<!ENTITY only_favorite_folders.tooltip "V zahrnutých typoch zložiek a zahrnutých účtoch, počítať len správy v obľúbených zložkách">
<!ENTITY account_or_server_type_name "Účet">
<!ENTITY account_or_server_type_name.tooltip "Typ alebo názov účtu">
@ -91,3 +90,11 @@
<!ENTITY chat_icon_enable.label "Zapnúť ikonu chatu">
<!ENTITY chat_icon_enable.accesskey "E">
<!ENTITY chat_icon_blink.label "Chat icon blinks on new messages">
<!ENTITY chat_icon_blink.accesskey "C">
<!ENTITY chat_icon_blink.tooltip "when private message or cited in a channel">
<!ENTITY chat_icon_blink_style.label "Blink style">
<!ENTITY chat_icon_blink_style.accesskey "B">
<!ENTITY chat_icon_blink_style_normal "Simple">
<!ENTITY chat_icon_blink_style_fade "Fade">

View File

@ -130,7 +130,7 @@ firetray.Handler = {
firetray.Utils.addObservers(firetray.Handler, [ "sessionstore-windows-restored" ]);
} else if (this.appId === FIRETRAY_APP_DB['thunderbird']['id']) {
this.restoredWindowsCount = this.readTBRestoreWindowsCount();
log.debug("restoredWindowsCount="+this.restoredWindowsCount);
log.info("restoredWindowsCount="+this.restoredWindowsCount);
if (!this.restoredWindowsCount) {
log.error("session file could not be read");
this.restoredWindowsCount = 1; // default
@ -250,7 +250,7 @@ firetray.Handler = {
break;
case "mail-startup-done": // or xul-window-visible, mail-tabs-session-restored ?
log.info(topic+": "+subject+","+data);
log.debug(topic+": "+subject+","+data);
if (firetray.Handler.restoredWindowsCount &&
!--firetray.Handler.restoredWindowsCount) {
firetray.Utils.removeObservers(firetray.Handler, [ topic ]);

View File

@ -331,7 +331,7 @@ firetray.Handler.setIconText = function(text, color) { // FIXME: function too lo
gdk.gdk_pixbuf_composite(bufAlpha,dest,0,0,w,h,0,0,1,1,gdk.GDK_INTERP_BILINEAR,255);
gobject.g_object_unref(bufAlpha);
log.info("gtk_status_icon_set_from_pixbuf="+dest);
log.debug("gtk_status_icon_set_from_pixbuf="+dest);
gtk.gtk_status_icon_set_from_pixbuf(firetray.StatusIcon.trayIcon, dest);
} catch (x) {
log.error(x);

View File

@ -272,8 +272,9 @@ firetray.Window = {
startupHide: function(xid) {
log.debug('startupHide: '+xid);
firetray.Handler.windows[xid].baseWin.visibility = false;
firetray.Window.updateVisibility(xid, false);
// also it seems cleaner, baseWin.visibility=false removes the possibility
// to restore the app by calling it from the command line. Not sure why...
firetray.Window.setVisibility(xid, false);
firetray.PopupMenu.showWindowItem(xid);
firetray.Handler.showHideIcon();
@ -554,7 +555,9 @@ firetray.Window = {
let gdkWinStateOnMap = gdk.gdk_window_get_state(firetray.Handler.gdkWindows.get(xid));
log.debug("gdkWinState="+gdkWinStateOnMap+" for xid="+xid);
let win = firetray.Handler.windows[xid];
if (firetray.Handler.appStarted && !win.visible) { // happens when hidden app called from command line
if (firetray.Handler.appStarted && !win.visible) {
// when app hidden at startup, then called from command line without
// any argument (not through FireTray that is)
log.warn("window not visible, correcting visibility");
firetray.Window.updateVisibility(xid, true);
log.debug("visibleWindowsCount="+firetray.Handler.visibleWindowsCount);