[Pkg-mozext-commits] [firetray] 230/399: 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.

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:23:49 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch dfsg-clean
in repository firetray.

commit f86a3ac7942a5bd2d0d48d6254ca5420e902d67f
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Mon Apr 23 00:32:01 2012 +0200

    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.
---
 src/modules/ctypes/linux/gtk.jsm     |    2 +-
 src/modules/linux/FiretrayWindow.jsm |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/ctypes/linux/gtk.jsm b/src/modules/ctypes/linux/gtk.jsm
index 2ae8d3b..5dfd936 100644
--- a/src/modules/ctypes/linux/gtk.jsm
+++ b/src/modules/ctypes/linux/gtk.jsm
@@ -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);
diff --git a/src/modules/linux/FiretrayWindow.jsm b/src/modules/linux/FiretrayWindow.jsm
index aed2507..9229851 100644
--- a/src/modules/linux/FiretrayWindow.jsm
+++ b/src/modules/linux/FiretrayWindow.jsm
@@ -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 :

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git



More information about the Pkg-mozext-commits mailing list