use Gtk gtk_widget_show/hide instead of Moz BaseWindow.visibility. This ensures

Thunderbird to be shown, when launched from the command line, while already
running.

NOTE: gdk_window_show/hide also works, but we'd lose the ability to resize and
move the windows before showing it when restoring.
This commit is contained in:
foudfou 2012-04-23 00:32:01 +02:00
parent 8d0917ab62
commit f86a3ac794
2 changed files with 7 additions and 2 deletions

View File

@ -93,7 +93,6 @@ function gtk_defines(lib) {
lib.lazy_bind("gtk_image_menu_item_set_image", ctypes.void_t, this.GtkImageMenuItem.ptr, this.GtkWidget.ptr);
lib.lazy_bind("gtk_menu_shell_append", ctypes.void_t, this.GtkMenuShell.ptr, this.GtkWidget.ptr);
lib.lazy_bind("gtk_menu_shell_prepend", ctypes.void_t, this.GtkMenuShell.ptr, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_show_all", ctypes.void_t, this.GtkWidget.ptr);
lib.lazy_bind("gtk_menu_popup", ctypes.void_t, this.GtkMenu.ptr, this.GtkWidget.ptr, this.GtkWidget.ptr, this.GtkMenuPositionFunc_t, gobject.gpointer, gobject.guint, gobject.guint);
lib.lazy_bind("gtk_status_icon_position_menu", ctypes.void_t, this.GtkMenu.ptr, gobject.gint.ptr, gobject.gint.ptr, gobject.gboolean.ptr, gobject.gpointer);
lib.lazy_bind("gtk_separator_menu_item_new", this.GtkWidget.ptr);
@ -113,6 +112,7 @@ function gtk_defines(lib) {
lib.lazy_bind("gtk_widget_hide_on_delete", gobject.gboolean, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_hide", ctypes.void_t, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_show", ctypes.void_t, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_show_all", ctypes.void_t, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_get_events", gobject.gint, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_get_events", gobject.gint, this.GtkWidget.ptr);
lib.lazy_bind("gtk_widget_add_events", ctypes.void_t, this.GtkWidget.ptr, gobject.gint);

View File

@ -320,7 +320,12 @@ firetray.Window = {
},
setVisibility: function(xid, visibility) {
firetray.Handler.windows[xid].baseWin.visibility = visibility;
let gtkWidget = ctypes.cast(firetray.Handler.gtkWindows.get(xid), gtk.GtkWidget.ptr);
if (visibility)
gtk.gtk_widget_show_all(gtkWidget);
else
gtk.gtk_widget_hide(gtkWidget);
firetray.Handler.windows[xid].visibility = visibility;
firetray.Handler.visibleWindowsCount = visibility ?
firetray.Handler.visibleWindowsCount + 1 :