Index: configure.in
===================================================================
RCS file: /cvs/gnome/goobox/configure.in,v
retrieving revision 1.55
diff -u -r1.55 configure.in
--- configure.in	17 Apr 2006 14:25:10 -0000	1.55
+++ configure.in	3 Oct 2006 15:51:34 -0000
@@ -26,7 +26,7 @@
 GNOME_VFS_REQUIRED=2.6.0
 LIBGLADE_REQUIRED=2.4.0
 GSTREAMER_REQUIRED=0.8.11
-LIBNOTIFY_REQUIRED=0.2.1
+LIBNOTIFY_REQUIRED=0.3.2
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GTK_REQUIRED)
@@ -81,6 +81,21 @@
 AC_MSG_RESULT($use_libglade_2_5)
 
 dnl
+dnl Gtk+ supports GtkStatusIcon (>=Gtk+-2.10)
+dnl
+have_gtk_2_10=no
+if test x"$have_gtk_2_5" = "xyes"; then
+   AC_MSG_CHECKING(for GtkStatusIcon)
+   if pkg-config --atleast-version=2.10.0 gtk+-2.0; then
+      have_gtk_2_10="yes"
+      AC_DEFINE(HAVE_GTK_2_10, 1, [Have gtk+ 2.10.x])
+      LIBNOTIFY_REQUIRED=0.4.2
+   fi
+   AC_MSG_RESULT($have_gtk_2_10)
+fi
+AM_CONDITIONAL(HAVE_GTK_2_10, test x"$have_gtk_2_10" = "xyes")
+
+dnl
 dnl IDL modules
 dnl
 IDL_MODULES="bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0"
@@ -231,6 +246,7 @@
         Compiler:               ${CC}
     	Have Gtk+ 2.5.x:        ${have_gtk_2_5}
     	Use LibGlade 2.5.x:     ${use_libglade_2_5}
+	Have GtkStatusIcon:     ${have_gtk_2_10}
 	Enable multimedia keys: ${use_mmkeys}
 	Enable notification:    ${have_libnotify}
 "
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/goobox/src/Makefile.am,v
retrieving revision 1.12
diff -u -r1.12 Makefile.am
--- src/Makefile.am	9 Nov 2005 21:02:43 -0000	1.12
+++ src/Makefile.am	3 Oct 2006 15:51:34 -0000
@@ -96,8 +96,6 @@
 	dlg-preferences.h			\
 	dlg-ripper.c				\
 	dlg-ripper.h				\
-	eggtrayicon.c				\
-	eggtrayicon.h				\
 	file-list.c				\
 	file-list.h				\
 	file-utils.c				\
@@ -150,6 +148,14 @@
 	ui.h					\
 	utf8-fnmatch.c				\
 	utf8-fnmatch.h
+
+if HAVE_GTK_2_10
+goobox_SOURCES +=
+else
+goobox_SOURCES +=		\
+	eggtrayicon.c		\
+	eggtrayicon.h
+endif
 
 goo-marshal.h: goo-marshal.list $(GLIB_GENMARSHAL)
 	$(GLIB_GENMARSHAL) $< --header --prefix=goo_marshal > $@
Index: src/goo-window.c
===================================================================
RCS file: /cvs/gnome/goobox/src/goo-window.c,v
retrieving revision 1.52
diff -u -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 15:51:35 -0000
@@ -33,7 +33,11 @@
 
 #include "actions.h"
 #include "dlg-cover-chooser.h"
+
+#ifndef HAVE_GTK_2_10
 #include "eggtrayicon.h"
+#endif
+
 #include "file-utils.h"
 #include "goo-marshal.h"
 #include "goo-stock.h"
@@ -91,10 +95,14 @@
 	GtkWidget       *info;
 	GtkWidget       *volume_button;
 
-	GtkWidget       *tray;
-	GtkWidget       *tray_box;
-	GtkWidget       *tray_icon;
-	GtkTooltips     *tray_tips;
+#ifdef HAVE_GTK_2_10
+	GtkStatusIcon   *tray;
+#else
+	GtkWidget	*tray;
+	GtkWidget	*tray_box;
+	GtkWidget	*tray_icon;
+	GtkWidget	*tray_tips;
+#endif
 
 	GtkTooltips     *tooltips;
 	guint            help_message_cid;
@@ -598,7 +606,19 @@
 
 		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
 		g_object_unref (priv->list_store);
-		
+
+#ifdef HAVE_GTK_2_10
+		if (priv->tray != NULL) {
+			g_object_unref (priv->tray);
+			priv->tray = NULL;
+		}
+
+		if (priv->tray_popup_menu != NULL) {
+			g_object_unref (G_OBJECT (priv->tray_popup_menu));
+			priv->tray_popup_menu = NULL;
+		}
+#endif
+
 		if (priv->playlist != NULL)
 			g_list_free (priv->playlist);
 
@@ -1368,19 +1388,24 @@
 				g_string_append_printf (info, "<i>%s</i>", e_album);
 				g_free (e_album);
 			}
-
+#ifndef HAVE_GTK_2_10
 			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;
+				y += (h / 2);
 				x += (w / 2);
 			}
+#endif
 			system_notify (priv->current_song->title,
 				       info->str,
-				       x, y);
-
+				       x, y,
+#ifdef HAVE_GTK_2_10
+				       priv->tray);
+#else
+				       priv->tray_icon);
+#endif
 			g_string_free (info, TRUE);
 			priv->notify_action = FALSE;
 		}
@@ -1510,13 +1535,16 @@
 
 	gtk_window_set_title (GTK_WINDOW (window), title->str);
 
+#ifdef HAVE_GTK_2_10
+	gtk_status_icon_set_tooltip (priv->tray, title->str);
+#else
 	if (priv->tray_tips != NULL) {
 		gtk_tooltips_set_tip (GTK_TOOLTIPS (priv->tray_tips), 
 				      priv->tray_box, 
 				      title->str,
 				      NULL);
 	}
-
+#endif
 	g_string_free (title, TRUE);
 }
 
@@ -2107,8 +2135,23 @@
 	return retval;
 }
 
+#ifdef HAVE_GTK_2_10
+static void
+tray_icon_clicked (GtkStatusIcon *status_icon, GooWindow *window)
+{
+	goo_window_toggle_visibility (window);
+}
 
 static void
+tray_icon_popup (GtkStatusIcon *status_icon, guint button,
+		 guint activate_time, GooWindow *window)
+{
+	gtk_menu_popup (GTK_MENU (window->priv->tray_popup_menu), NULL, NULL,
+			gtk_status_icon_position_menu,
+			status_icon, button, activate_time);
+}
+#else
+static void
 tray_object_destroyed (GooWindow *window)
 {
 	GooWindowPrivateData *priv = window->priv;
@@ -2180,7 +2223,7 @@
 
 	return FALSE;
 }
-
+#endif
 
 static void
 volume_button_changed_cb (GooVolumeToolButton *button,
@@ -2533,7 +2576,16 @@
 					   TRUE);
 
 	/* Create the tray icon. */
+#ifdef HAVE_GTK_2_10
+	priv->tray = gtk_status_icon_new_from_stock (GOO_STOCK_NO_COVER);
+
+	gtk_status_icon_set_tooltip (priv->tray, _("CD Player"));
 	
+	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);
+#else
 	priv->tray = GTK_WIDGET (egg_tray_icon_new ("Goobox"));
 	priv->tray_box = gtk_event_box_new ();
 	
@@ -2570,10 +2622,12 @@
 			      priv->tray_box, 
 			      _("CD Player"), 
 			      NULL);
-
+#endif
 	priv->tray_popup_menu = gtk_ui_manager_get_widget (ui, "/TrayPopupMenu");
+#ifndef HAVE_GTK_2_10
 	gnome_popup_menu_attach (priv->tray_popup_menu, priv->tray_box, NULL);
 	gtk_widget_show_all (priv->tray);
+#endif
 
 	/* Add notification callbacks. */
 
Index: src/main.c
===================================================================
RCS file: /cvs/gnome/goobox/src/main.c,v
retrieving revision 1.15
diff -u -r1.15 main.c
--- src/main.c	5 Jan 2006 16:01:12 -0000	1.15
+++ src/main.c	3 Oct 2006 15:51:36 -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 @@
 
 
 #ifdef HAVE_LIBNOTIFY
-	if (! notify_init ("goobox")) 
+	if (!notify_init ("goobox")) 
                 g_warning ("Cannot initialize notification system.");
 #endif /* HAVE_LIBNOTIFY */
 
@@ -549,38 +549,37 @@
 
 #endif /* HAVE_MMKEYS */
 
-
 void 
 system_notify (const char *title,
 	       const char *msg,
 	       int         x,
-	       int         y)
+	       int         y,
+	       gpointer    widget)
 {
 #ifdef HAVE_LIBNOTIFY
+	GError *error = NULL;
+	
 	if(!notify_is_initted())
 		return;
-
-	NotifyIcon  *icon = notify_icon_new_from_uri("goobox");
-	NotifyHints *hints = NULL;
+#ifdef HAVE_GTK_2_10
+	notify_n = notify_notification_new (title, msg, "goobox", NULL);
+	notify_notification_attach_to_status_icon (notify_n, GTK_STATUS_ICON (widget));
+#else
+	notify_n = notify_notification_new (title, msg, "goobox", GTK_WIDGET (widget));
+#endif
+	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 -r1.6 main.h
--- src/main.h	18 Nov 2005 20:24:55 -0000	1.6
+++ src/main.h	3 Oct 2006 15:51:36 -0000
@@ -32,6 +32,7 @@
 void system_notify (const char *title,
 		    const char *msg,
 		    int         x,
-		    int         y);
+		    int         y,
+		    gpointer    widget);
 
 #endif /* MAIN_H */
