Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
use Gtk gtk_widget_show/hide instead of Moz BaseWindow.visibility. Th…
Browse files Browse the repository at this point in the history
…is 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.
  • Loading branch information
foudfou committed Apr 22, 2012
1 parent 8d0917a commit f86a3ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/ctypes/linux/gtk.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion src/modules/linux/FiretrayWindow.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down

0 comments on commit f86a3ac

Please # to comment.