Index: configure.in
===================================================================
RCS file: /cvs/gnome/goobox/configure.in,v
retrieving revision 1.55
diff -u -p -r1.55 configure.in
--- configure.in	17 Apr 2006 14:25:10 -0000	1.55
+++ configure.in	3 Oct 2006 12:55:03 -0000
@@ -19,14 +19,14 @@ dnl
 dnl ==========================================================================
 
 GLIB_REQUIRED=2.4.0
-GTK_REQUIRED=2.4.0
+GTK_REQUIRED=2.9.2
 LIBGNOME_REQUIRED=2.6.0
 LIBGNOMEUI_REQUIRED=2.6.0
 LIBBONOBO_REQUIRED=2.6.0
 GNOME_VFS_REQUIRED=2.6.0
 LIBGLADE_REQUIRED=2.4.0
 GSTREAMER_REQUIRED=0.8.11
-LIBNOTIFY_REQUIRED=0.2.1
+LIBNOTIFY_REQUIRED=0.4.1
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GTK_REQUIRED)
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/goobox/src/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- src/Makefile.am	9 Nov 2005 21:02:43 -0000	1.12
+++ src/Makefile.am	3 Oct 2006 12:55:04 -0000
@@ -96,8 +96,6 @@ goobox_SOURCES = 				\
 	dlg-preferences.h			\
 	dlg-ripper.c				\
 	dlg-ripper.h				\
-	eggtrayicon.c				\
-	eggtrayicon.h				\
 	file-list.c				\
 	file-list.h				\
 	file-utils.c				\
Index: src/goo-window.c
===================================================================
RCS file: /cvs/gnome/goobox/src/goo-window.c,v
retrieving revision 1.52
diff -u -p -r1.52 goo-window.c
--- src/goo-window.c	18 Nov 2005 20:24:55 -0000	1.52
+++ src/goo-window.c	3 Oct 2006 12:55:05 -0000
@@ -33,7 +33,6 @@
 
 #include "actions.h"
 #include "dlg-cover-chooser.h"
-#include "eggtrayicon.h"
 #include "file-utils.h"
 #include "goo-marshal.h"
 #include "goo-stock.h"
@@ -91,10 +90,7 @@ struct _GooWindowPrivateData {
 	GtkWidget       *info;
 	GtkWidget       *volume_button;
 
-	GtkWidget       *tray;
-	GtkWidget       *tray_box;
-	GtkWidget       *tray_icon;
-	GtkTooltips     *tray_tips;
+	GtkStatusIcon   *tray;
 
 	GtkTooltips     *tooltips;
 	guint            help_message_cid;
@@ -598,6 +594,11 @@ goo_window_finalize (GObject *object)
 
 		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
 		g_object_unref (priv->list_store);
+
+		if (priv->tray != NULL) {
+			g_object_unref (priv->tray);
+			priv->tray = NULL;
+		}
 		
 		if (priv->playlist != NULL)
 			g_list_free (priv->playlist);
@@ -612,6 +613,11 @@ goo_window_finalize (GObject *object)
 			priv->cover_popup_menu = NULL;
 		}
 
+		if (priv->tray_popup_menu != NULL) {
+			g_object_unref (G_OBJECT (priv->tray_popup_menu));
+			priv->tray_popup_menu = NULL;
+		}
+
 		song_list_free (priv->song_list);
 
 		g_signal_handlers_disconnect_by_data (priv->player, window);
@@ -1369,17 +1375,9 @@ player_start_cb (GooPlayer       *player
 				g_free (e_album);
 			}
 
-			if (priv->tray != NULL) {
-				GdkWindow *win = priv->tray->window;
-				int        w, h;
-				gdk_window_get_origin (win, &x, &y);
-				gdk_window_get_geometry (win, NULL, NULL, &w, &h, NULL);
-				y += h;
-				x += (w / 2);
-			}
 			system_notify (priv->current_song->title,
 				       info->str,
-				       x, y);
+				       x, y, priv->tray);
 
 			g_string_free (info, TRUE);
 			priv->notify_action = FALSE;
@@ -1510,12 +1508,7 @@ window_update_title (GooWindow *window)
 
 	gtk_window_set_title (GTK_WINDOW (window), title->str);
 
-	if (priv->tray_tips != NULL) {
-		gtk_tooltips_set_tip (GTK_TOOLTIPS (priv->tray_tips), 
-				      priv->tray_box, 
-				      title->str,
-				      NULL);
-	}
+	gtk_status_icon_set_tooltip (priv->tray, title->str);
 
 	g_string_free (title, TRUE);
 }
@@ -2107,81 +2100,21 @@ window_key_press_cb (GtkWidget   *widget
 	return retval;
 }
 
-
 static void
-tray_object_destroyed (GooWindow *window)
-{
-	GooWindowPrivateData *priv = window->priv;
-
-	gtk_object_unref (GTK_OBJECT (priv->tray_tips));
-	priv->tray_tips = NULL;
-
-	if (priv->tray_popup_menu != NULL) {
-		gtk_widget_destroy (priv->file_popup_menu);
-		priv->file_popup_menu = NULL;
-	}
-
-	priv->tray = NULL;
-}
-
-
-static gboolean
-tray_icon_clicked (GtkWidget      *widget, 
-		   GdkEventButton *event,
-		   GooWindow      *window)
+tray_icon_clicked (GtkStatusIcon *status_icon, GooWindow *window)
 {
-	if (event->button == 3) 
-		return FALSE;
-
 	goo_window_toggle_visibility (window);
-
-	return TRUE;
 }
 
-
-static gboolean
-tray_icon_pressed (GtkWidget   *widget, 
-		   GdkEventKey *event, 
-		   GooWindow   *window)
-{
-	if ((event->keyval == GDK_space) 
-	    || (event->keyval == GDK_KP_Space) 
-	    || (event->keyval == GDK_Return)
-	    || (event->keyval == GDK_KP_Enter)) {
-		goo_window_toggle_visibility (window);
-		return TRUE;
-	} else 
-		return FALSE;
-}
-
-
-static int
-tray_icon_expose (GtkWidget      *widget,
-		  GdkEventExpose *event)
+static void
+tray_icon_popup (GtkStatusIcon *status_icon, guint button,
+		 guint activate_time, GooWindow *window)
 {
-	int focus_width, focus_pad;
-	int x, y, width, height;
-
-	if (! GTK_WIDGET_HAS_FOCUS (gtk_widget_get_parent (widget)))
-		return FALSE;
-	
-	gtk_widget_style_get (widget,
-			      "focus-line-width", &focus_width,
-			      "focus-padding", &focus_pad,
-			      NULL);
-	x = widget->allocation.x + focus_pad;
-	y = widget->allocation.y + focus_pad;
-	width = widget->allocation.width - 2 * focus_pad;
-	height = widget->allocation.height - 2 * focus_pad;
-	gtk_paint_focus (widget->style, widget->window,
-			 GTK_STATE_NORMAL,
-			 &event->area, widget, "button",
-			 x, y, width, height);
-
-	return FALSE;
+	gtk_menu_popup (GTK_MENU (window->priv->tray_popup_menu), NULL, NULL,
+			gtk_status_icon_position_menu,
+			status_icon, button, activate_time);
 }
 
-
 static void
 volume_button_changed_cb (GooVolumeToolButton *button,
 			  GooWindow           *window)
@@ -2534,46 +2467,16 @@ goo_window_construct (GooWindow  *window
 
 	/* Create the tray icon. */
 	
-	priv->tray = GTK_WIDGET (egg_tray_icon_new ("Goobox"));
-	priv->tray_box = gtk_event_box_new ();
-	
-	g_signal_connect (G_OBJECT (priv->tray_box), 
-			  "button_press_event",
-			  G_CALLBACK (tray_icon_clicked), 
-			  window);
-	g_signal_connect (G_OBJECT (priv->tray_box), 
-			  "key_press_event",
-			  G_CALLBACK (tray_icon_pressed),
-			  window);
-
-	g_object_set_data_full (G_OBJECT (priv->tray), 
-				"tray-action-data", 
-				window,
-				(GDestroyNotify) tray_object_destroyed);
-
-	gtk_container_add (GTK_CONTAINER (priv->tray), priv->tray_box);
-	priv->tray_icon = gtk_image_new_from_stock (GOO_STOCK_NO_COVER, GTK_ICON_SIZE_BUTTON);
-
-	g_signal_connect (G_OBJECT (priv->tray_icon), 
-			  "expose_event",
-			  G_CALLBACK (tray_icon_expose), 
-			  window);
+	priv->tray = gtk_status_icon_new_from_stock (GOO_STOCK_NO_COVER);
 
-	GTK_WIDGET_SET_FLAGS (priv->tray_box, GTK_CAN_FOCUS);
-	atk_object_set_name (gtk_widget_get_accessible (priv->tray_box), _("CD Player"));
+	gtk_status_icon_set_tooltip (priv->tray, _("CD Player"));
 	
-	gtk_container_add (GTK_CONTAINER (priv->tray_box), priv->tray_icon);
-	priv->tray_tips = gtk_tooltips_new ();
-	gtk_object_ref (GTK_OBJECT (priv->tray_tips));
-	gtk_object_sink (GTK_OBJECT (priv->tray_tips));
-	gtk_tooltips_set_tip (GTK_TOOLTIPS (priv->tray_tips), 
-			      priv->tray_box, 
-			      _("CD Player"), 
-			      NULL);
+	g_signal_connect (G_OBJECT (priv->tray), "activate",
+				G_CALLBACK (tray_icon_clicked), window);
+	g_signal_connect (G_OBJECT (priv->tray), "popup-menu",
+				G_CALLBACK (tray_icon_popup), window);
 
 	priv->tray_popup_menu = gtk_ui_manager_get_widget (ui, "/TrayPopupMenu");
-	gnome_popup_menu_attach (priv->tray_popup_menu, priv->tray_box, NULL);
-	gtk_widget_show_all (priv->tray);
 
 	/* Add notification callbacks. */
 
Index: src/main.c
===================================================================
RCS file: /cvs/gnome/goobox/src/main.c,v
retrieving revision 1.15
diff -u -p -r1.15 main.c
--- src/main.c	5 Jan 2006 16:01:12 -0000	1.15
+++ src/main.c	3 Oct 2006 12:55:05 -0000
@@ -47,7 +47,7 @@
 
 #ifdef HAVE_LIBNOTIFY
 #include <libnotify/notify.h>
-static NotifyHandle *notify_h = NULL;
+static NotifyNotification *notify_n = NULL;
 #endif /* HAVE_LIBNOTIFY */
 
 GtkWindow *main_window = NULL;
@@ -192,7 +192,7 @@ int main (int argc, char **argv)
 
 
 #ifdef HAVE_LIBNOTIFY
-	if (! notify_init ("goobox")) 
+	if (!notify_init ("goobox")) 
                 g_warning ("Cannot initialize notification system.");
 #endif /* HAVE_LIBNOTIFY */
 
@@ -554,33 +554,29 @@ void 
 system_notify (const char *title,
 	       const char *msg,
 	       int         x,
-	       int         y)
+	       int         y,
+	       GtkStatusIcon *status_icon)
 {
 #ifdef HAVE_LIBNOTIFY
+	GError *error = NULL;
+	
 	if(!notify_is_initted())
 		return;
-
-	NotifyIcon  *icon = notify_icon_new_from_uri("goobox");
-	NotifyHints *hints = NULL;
+	notify_n = notify_notification_new (title, msg, "goobox", NULL);
+	notify_notification_attach_to_status_icon (notify_n, status_icon);
+	notify_notification_set_urgency (notify_n, NOTIFY_URGENCY_NORMAL);
+	notify_notification_set_timeout (notify_n, NOTIFY_EXPIRES_DEFAULT);
 
 	if ((x >= 0) && (y >= 0)) {
-		hints = notify_hints_new ();
-		notify_hints_set_int (hints, "x", x);
-		notify_hints_set_int (hints, "y", y);
+		notify_notification_set_hint_int32 (notify_n, "x", x);
+		notify_notification_set_hint_int32 (notify_n, "y", y);
 	}
-
-	notify_h = notify_send_notification (notify_h,
-					     "device",
-					     NOTIFY_URGENCY_NORMAL,
-					     title,
-					     msg,
-					     icon,
-					     TRUE, 0, 
-					     hints, // no hints
-					     NULL, // no user data
-					     0);
 	
-	if (icon != NULL)
-		notify_icon_destroy (icon);
+	if(!notify_notification_show (notify_n, &error))
+	{
+		g_print("Failed to notify: %s\n", error->message);
+		g_error_free (error);
+	}
+	g_object_unref (G_OBJECT (notify_n));
 #endif /* HAVE_LIBNOTIFY */
 }
Index: src/main.h
===================================================================
RCS file: /cvs/gnome/goobox/src/main.h,v
retrieving revision 1.6
diff -u -p -r1.6 main.h
--- src/main.h	18 Nov 2005 20:24:55 -0000	1.6
+++ src/main.h	3 Oct 2006 12:55:05 -0000
@@ -32,6 +32,7 @@ extern int HideShow;
 void system_notify (const char *title,
 		    const char *msg,
 		    int         x,
-		    int         y);
+		    int         y,
+		    GtkStatusIcon *status_icon);
 
 #endif /* MAIN_H */
