Index: configure.ac
===================================================================
RCS file: /cvs/gnome/gnome-mud/configure.ac,v
retrieving revision 1.63
diff -u -B -r1.63 configure.ac
--- configure.ac	25 May 2006 17:33:28 -0000	1.63
+++ configure.ac	30 Jul 2006 14:52:21 -0000
@@ -51,7 +51,7 @@
 
 dnl pkg-config dep checks
 GMODULE_REQUIRED=2.0.0
-GTK_REQUIRED=2.6.0
+GTK_REQUIRED=2.10.0
 LIBGLADE_REQUIRED=2.0.1
 LIBGNETWORK_REQUIRED=0.0.6
 VTE_REQUIRED=0.11.00
@@ -123,7 +123,7 @@
 	AC_CHECK_LIB(dld, shl_load, DL_LIB="-ldld",[
 	AC_CHECK_FUNCS(dlopen, DL_LIB="",
 	AC_MSG_ERROR(Dynamic linking is not available on this platform.))])])
-AC_SUBST(DL_LIB)  
+AC_SUBST(DL_LIB)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -149,10 +149,10 @@
 dnl 		if test "$PY_MAJOR" = "1."; then
 dnl 			python=no
 dnl 			AC_MSG_RESULT([no, atlest Python 2.x is needed])
-dnl 		else 
+dnl 		else
 dnl 			AC_MSG_RESULT([yes, Python $PY_VERSION])
 dnl 			AC_MSG_CHECKING(for Python compile flags)
-dnl 			
+dnl
 dnl 			if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
 dnl 				PY_LIBS="-lpython$PY_VERSION"
 dnl 				PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config"
@@ -168,7 +168,7 @@
 dnl 				CFLAGS="$CFLAGS $PY_CFLAGS"
 dnl 				CPPFLAGS="$CPPFLAGS $PY_CFLAGS"
 dnl 				LIBS="$LIBS $PY_LIB_LOC $PY_LIBS"
-dnl 				
+dnl
 dnl 				dnl PyGTK
 dnl 				PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 1.99.13, [
 dnl 					AC_DEFINE(USE_PYGTK, 1, [Define this if you want PyGtk support in Python scripts.])
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-mud/src/Makefile.am,v
retrieving revision 1.47
diff -u -B -r1.47 Makefile.am
--- src/Makefile.am	15 May 2006 12:55:32 -0000	1.47
+++ src/Makefile.am	30 Jul 2006 14:52:21 -0000
@@ -20,8 +20,6 @@
 games_PROGRAMS = gnome-mud
 
 gnome_mud_SOURCES =				\
-	eggtrayicon.c				\
-	eggtrayicon.h				\
 	gconf-helper.c				\
 	gconf-helper.h				\
 	gnome-mud.c					\
Index: src/mud-tray.c
===================================================================
RCS file: /cvs/gnome/gnome-mud/src/mud-tray.c,v
retrieving revision 1.4
diff -u -B -r1.4 mud-tray.c
--- src/mud-tray.c	23 Apr 2006 17:31:13 -0000	1.4
+++ src/mud-tray.c	30 Jul 2006 14:52:21 -0000
@@ -25,7 +25,6 @@
 #include <gtk/gtkwidget.h>
 
 #include "gnome-mud.h"
-#include "eggtrayicon.h"
 #include "mud-connection-view.h"
 #include "mud-window.h"
 #include "mud-tray.h"
@@ -33,13 +32,12 @@
 struct _MudTrayPrivate
 {
 	MudWindow *mainWindow;
-	
+
 	GtkWidget *window;
-	EggTrayIcon *tray_icon;
-	GtkWidget *image;
+	GtkStatusIcon *icon;
 	gboolean window_invisible;
 };
-	
+
 GType mud_tray_get_type (void);
 static void mud_tray_init (MudTray *tray);
 static void mud_tray_class_init (MudTrayClass *klass);
@@ -48,10 +46,7 @@
 void mud_tray_window_toggle(GtkWidget *widget, MudTray *tray);
 void mud_tray_window_exit(GtkWidget *widget, MudTray *tray);
 gboolean mud_tray_create_cb(gpointer data);
-void mud_tray_destroyed_cb(GtkWidget *widget, void *data);
-void mud_tray_clicked_cb(GtkWidget *button, GdkEventButton *event, void *data);
 
-void mud_tray_menu(MudTray *tray);
 void mud_tray_create(MudTray *tray);
 void mud_tray_destroy(MudTray *tray);
 
@@ -91,10 +86,9 @@
 	tray->priv = g_new0(MudTrayPrivate, 1);
 
 	tray->priv->window = NULL;
-	tray->priv->tray_icon = NULL;
-	tray->priv->image = NULL;
+	tray->priv->icon = NULL;
 	tray->priv->window_invisible = FALSE;
-	
+
         mud_tray_create(tray);
 }
 
@@ -114,7 +108,7 @@
 
 	tray = MUD_TRAY(object);
 
-	mud_tray_destroy(tray);        
+	mud_tray_destroy(tray);
 	g_free(tray->priv);
 
 	parent_class = g_type_class_peek_parent(G_OBJECT_GET_CLASS(object));
@@ -139,50 +133,20 @@
 gboolean mud_tray_create_cb(gpointer data)
 {
 	MudTray *tray = MUD_TRAY(data);
-	
+
         mud_tray_create(tray);
 
         return FALSE; /* for when we're called by the glib idle handler */
 }
 
-
-void mud_tray_destroyed_cb(GtkWidget *widget, void *data)
+void mud_tray_activate_cb(GtkStatusIcon *icon, MudTray *tray)
 {
-	MudTray *tray = MUD_TRAY(data);
-	
-        g_object_unref(G_OBJECT(tray->priv->tray_icon));
-        tray->priv->tray_icon = NULL;
-
-        // for some reason, our tray icon was destroyed, re-create it!
-        g_idle_add(mud_tray_create_cb, &data);
+	mud_tray_window_toggle(NULL, tray);
 }
 
-void mud_tray_clicked_cb(GtkWidget *button, GdkEventButton *event, void *data)
-{
-	MudTray *tray = MUD_TRAY(data);
-	
-        if (event->type != GDK_BUTTON_PRESS)
-                return;
-
-        switch (event->button) {
-                case 1:
-                        // left-mouse button
-                        mud_tray_window_toggle(NULL, tray);
-                        break;
-                case 2:
-                        // middle-mouse button
-                        // suggestions anyone?
-                        break;
-                case 3:
-                        mud_tray_menu(tray);
-                        break;
-        }
-}
-
-
 
-// functions
-void mud_tray_menu(MudTray *tray)
+void mud_tray_popup_menu_cb(GtkStatusIcon *icon, guint button,
+                            guint activate_time, MudTray *tray)
 {
         static GtkWidget *menu = NULL;
         GtkWidget *entry;
@@ -206,7 +170,10 @@
         g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(mud_tray_window_exit), tray);
 
         gtk_widget_show_all(menu);
-        gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
+        gtk_menu_popup(GTK_MENU(menu),
+                       NULL, NULL,
+                       gtk_status_icon_position_menu, icon,
+                       button, activate_time);
 }
 
 void mud_tray_update_icon(MudTray *tray, enum mud_tray_status icon)
@@ -226,48 +193,34 @@
                         break;
         }
 
-        gtk_image_set_from_file(GTK_IMAGE(tray->priv->image), icon_name);
+        gtk_status_icon_set_from_file(tray->priv->icon, icon_name);
 }
 
-void 
+void
 mud_tray_create(MudTray *tray)
 {
-	GtkWidget *box;
-
-        if (tray->priv->tray_icon) {
+        if (tray->priv->icon) {
                 /* if this is being called when a tray icon exists, it's because
                    something messed up. try destroying it before we proceed */
                 g_message("Trying to create icon but it already exists?\n");
                 mud_tray_destroy(tray);
         }
-        
-	tray->priv->tray_icon = egg_tray_icon_new(_("GNOME Mud"));
-        box = gtk_event_box_new();
-        tray->priv->image = gtk_image_new();
-
-        g_signal_connect(G_OBJECT(tray->priv->tray_icon), "destroy", G_CALLBACK(mud_tray_destroyed_cb), tray);
-        g_signal_connect(G_OBJECT(box), "button-press-event", G_CALLBACK(mud_tray_clicked_cb), tray);
 
-        gtk_container_add(GTK_CONTAINER(box), tray->priv->image);
-        gtk_container_add(GTK_CONTAINER(tray->priv->tray_icon), box);
+        tray->priv->icon = gtk_status_icon_new(); /*(_("GNOME Mud"));*/
+        g_signal_connect(tray->priv->icon, "activate",
+                         G_CALLBACK (mud_tray_activate_cb), tray);
+        g_signal_connect(tray->priv->icon, "popup_menu",
+                         G_CALLBACK (mud_tray_popup_menu_cb), tray);
 
         mud_tray_update_icon(tray, offline_connecting);
-
-        gtk_widget_show_all(GTK_WIDGET(tray->priv->tray_icon));
-
-        /* ref the tray icon before we bandy it about the place */
-        g_object_ref(G_OBJECT(tray->priv->tray_icon));
 }
 
 void
 mud_tray_destroy(MudTray *tray)
 {
-        g_signal_handlers_disconnect_by_func(G_OBJECT(tray->priv->tray_icon), G_CALLBACK(mud_tray_destroyed_cb), tray);
-        gtk_widget_destroy(GTK_WIDGET(tray->priv->tray_icon));
+        g_object_unref(G_OBJECT(tray->priv->icon));
+        tray->priv->icon = NULL;
 
-        g_object_unref(G_OBJECT(tray->priv->tray_icon));
-        tray->priv->tray_icon = NULL;
-        
         g_object_unref(tray->priv->mainWindow);
 }
 
@@ -282,5 +235,5 @@
 	tray->priv->window = window;
 	tray->priv->mainWindow = mainWindow;
 
-	return tray;	
+	return tray;
 }
