changeset 876:04a56ecc9442 trunk

[svn] statusicon: do not behave strangely (or crash) when the plugin is loaded/unloaded multiple times
author giacomo
date Sun, 18 Mar 2007 16:21:10 -0700
parents 623eca8326e5
children ecf3cb97dba1
files ChangeLog src/statusicon/gtktrayicon-x11.c
diffstat 2 files changed, 46 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Mar 18 11:13:45 2007 -0700
+++ b/ChangeLog	Sun Mar 18 16:21:10 2007 -0700
@@ -1,3 +1,12 @@
+2007-03-18 18:13:45 +0000  Giacomo Lozito <james@develia.org>
+  revision [1850]
+  - aosd: beta3, fixes for handling X display open/close
+  trunk/src/aosd/aosd_common.h |    2 +-
+  trunk/src/aosd/aosd_osd.c    |    4 +++-
+  trunk/src/aosd/ghosd.c       |    1 +
+  3 files changed, 5 insertions(+), 2 deletions(-)
+
+
 2007-03-17 07:58:49 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1848]
   - clear up some configure bugs, pointed out by freebsd port patches
--- a/src/statusicon/gtktrayicon-x11.c	Sun Mar 18 11:13:45 2007 -0700
+++ b/src/statusicon/gtktrayicon-x11.c	Sun Mar 18 16:21:10 2007 -0700
@@ -76,7 +76,43 @@
 						    gboolean     dock_if_realized);
 static void gtk_tray_icon_manager_window_destroyed (GtkTrayIcon *icon);
 
-G_DEFINE_TYPE (GtkTrayIcon, gtk_tray_icon, GTK_TYPE_PLUG)
+static void     gtk_tray_icon_init       (GtkTrayIcon      *self);
+static void     gtk_tray_icon_class_init (GtkTrayIconClass *klass);
+static gpointer gtk_tray_icon_parent_class = NULL;
+static void     gtk_tray_icon_class_intern_init (gpointer klass)
+{
+  gtk_tray_icon_parent_class = g_type_class_peek_parent (klass);
+  gtk_tray_icon_class_init ((GtkTrayIconClass*) klass);
+}
+
+GType
+gtk_tray_icon_get_type (void)
+{
+  static GType g_define_type_id = 0;
+  g_define_type_id = g_type_from_name( "AudGtkTrayIcon" );
+  if (G_UNLIKELY (g_define_type_id == 0))
+    {
+      static const GTypeInfo g_define_type_info = {
+        sizeof (GtkTrayIconClass),
+        (GBaseInitFunc) NULL,
+        (GBaseFinalizeFunc) NULL,
+        (GClassInitFunc) gtk_tray_icon_class_intern_init,
+        (GClassFinalizeFunc) NULL,
+        NULL,   /* class_data */
+        sizeof (GtkTrayIcon),
+        0,      /* n_preallocs */
+        (GInstanceInitFunc) gtk_tray_icon_init,
+      };
+      g_define_type_id = g_type_register_static (GTK_TYPE_PLUG, "AudGtkTrayIcon", &g_define_type_info, 0);
+    }
+  else if ( gtk_tray_icon_parent_class == NULL )
+    {
+      gpointer klass = g_type_class_peek( g_define_type_id );
+      gtk_tray_icon_parent_class = g_type_class_peek_parent(klass);
+    }
+  return g_define_type_id; 
+}
+
 
 static void
 gtk_tray_icon_class_init (GtkTrayIconClass *class)