=== modified file 'configure.ac'
--- old/configure.ac	2010-02-03 17:58:31 +0000
+++ new/configure.ac	2010-02-03 18:03:04 +0000
@@ -46,6 +46,7 @@
 LIBSOUP_REQS=2.26.0
 GUDEV_REQS=143
 LIBMTP_REQS=0.3.0
+APPINDICATOR_REQS=0.0.10
 
 AC_MSG_CHECKING([for GNU extension fwrite_unlocked])
 AC_LINK_IFELSE(
@@ -74,6 +75,19 @@
 # libgnomeui still required with gtk < 2.14
 PKG_CHECK_EXISTS(gtk+-2.0 >= 2.14, [LIBGNOME_REQS=], [LIBGNOME_REQS=libgnomeui-2.0])
 
+# have libappindicator
+PKG_CHECK_EXISTS(appindicator-0.1 >= $APPINDICATOR_REQS, [
+        have_app_indicator=yes
+        AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
+], [have_app_indicator=no])
+AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$have_app_indicator" = xyes)
+if test x$have_app_indicator = xyes ; then
+   PKG_CHECK_MODULES(APP_INDICATOR,
+                     appindicator-0.1 >= $APPINDICATOR_REQS)
+   AC_SUBST(APP_INDICATOR_CFLAGS)
+   AC_SUBST(APP_INDICATOR_LIBS)
+fi
+
 # use gtk status icon with gtk >= 2.16
 PKG_CHECK_EXISTS(gtk+-2.0 >= 2.16, [
 	use_gtk_status_icon=yes
@@ -977,4 +991,10 @@
 	AC_MSG_NOTICE([   iTunes detection browser plugin (for podcasts) disabled])
 fi
 
+if test "x$have_app_indicator" != xno ; then
+        AC_MSG_NOTICE([** Application indicators enabled])
+else
+        AC_MSG_NOTICE([   Application indicators not enabled.])
+fi
+
 AC_MSG_NOTICE([End options])

=== modified file 'plugins/status-icon/Makefile.am'
--- old/plugins/status-icon/Makefile.am	2010-02-03 17:52:33 +0000
+++ new/plugins/status-icon/Makefile.am	2010-02-03 17:59:07 +0000
@@ -3,6 +3,11 @@
 plugindir = $(PLUGINDIR)/status-icon
 plugin_LTLIBRARIES = libstatus-icon.la
 
+if HAVE_APP_INDICATOR
+ICON_IMPL_FILES =					\
+	rb-indicator.h					\
+	rb-indicator.c
+else
 if USE_GTK_STATUS_ICON
 ICON_IMPL_FILES = \
 	rb-tray-icon-gtk.h 				\
@@ -14,6 +19,7 @@
 	rb-tray-icon.c \
 	rb-tray-icon.h
 endif
+endif
 
 libstatus_icon_la_SOURCES = \
 	rb-status-icon-plugin.h				\
@@ -28,6 +34,7 @@
 libstatus_icon_la_LIBADD = 				\
 	$(top_builddir)/shell/librhythmbox-core.la	\
 	$(NOTIFY_LIBS)					\
+	$(APP_INDICATOR_LIBS)				\
 	$(NULL)
 
 INCLUDES = 						\
@@ -44,6 +51,7 @@
 	-DSHARE_DIR=\"$(pkgdatadir)\"                   \
 	-DDATADIR=\""$(datadir)"\"			\
 	$(RHYTHMBOX_CFLAGS)				\
+	$(APP_INDICATOR_CFLAGS)				\
 	-D_XOPEN_SOURCE -D_BSD_SOURCE
 
 uixmldir = $(plugindir)

=== modified file 'plugins/status-icon/Makefile.in'
--- old/plugins/status-icon/Makefile.in	2010-02-03 17:52:33 +0000
+++ new/plugins/status-icon/Makefile.in	2010-02-03 17:59:07 +0000
@@ -79,15 +79,17 @@
 am__DEPENDENCIES_1 =
 libstatus_icon_la_DEPENDENCIES =  \
 	$(top_builddir)/shell/librhythmbox-core.la \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 am__libstatus_icon_la_SOURCES_DIST = rb-status-icon-plugin.h \
 	rb-status-icon-plugin.c eggtrayicon.c eggtrayicon.h \
 	rb-tray-icon.c rb-tray-icon.h rb-tray-icon-gtk.h \
-	rb-tray-icon-gtk.c
-@USE_GTK_STATUS_ICON_FALSE@am__objects_1 =  \
-@USE_GTK_STATUS_ICON_FALSE@	libstatus_icon_la-eggtrayicon.lo \
-@USE_GTK_STATUS_ICON_FALSE@	libstatus_icon_la-rb-tray-icon.lo
-@USE_GTK_STATUS_ICON_TRUE@am__objects_1 = libstatus_icon_la-rb-tray-icon-gtk.lo
+	rb-tray-icon-gtk.c rb-indicator.h rb-indicator.c
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@am__objects_1 = libstatus_icon_la-eggtrayicon.lo \
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@	libstatus_icon_la-rb-tray-icon.lo
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_TRUE@am__objects_1 = libstatus_icon_la-rb-tray-icon-gtk.lo
+@HAVE_APP_INDICATOR_TRUE@am__objects_1 =  \
+@HAVE_APP_INDICATOR_TRUE@	libstatus_icon_la-rb-indicator.lo
 am__objects_2 =
 am_libstatus_icon_la_OBJECTS =  \
 	libstatus_icon_la-rb-status-icon-plugin.lo $(am__objects_1) \
@@ -137,6 +139,8 @@
 ALL_LINGUAS = @ALL_LINGUAS@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@
+APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -361,15 +365,19 @@
 NULL = 
 plugindir = $(PLUGINDIR)/status-icon
 plugin_LTLIBRARIES = libstatus-icon.la
-@USE_GTK_STATUS_ICON_FALSE@ICON_IMPL_FILES = \
-@USE_GTK_STATUS_ICON_FALSE@	eggtrayicon.c \
-@USE_GTK_STATUS_ICON_FALSE@	eggtrayicon.h \
-@USE_GTK_STATUS_ICON_FALSE@	rb-tray-icon.c \
-@USE_GTK_STATUS_ICON_FALSE@	rb-tray-icon.h
-
-@USE_GTK_STATUS_ICON_TRUE@ICON_IMPL_FILES = \
-@USE_GTK_STATUS_ICON_TRUE@	rb-tray-icon-gtk.h 				\
-@USE_GTK_STATUS_ICON_TRUE@	rb-tray-icon-gtk.c
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@ICON_IMPL_FILES = \
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@	eggtrayicon.c \
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@	eggtrayicon.h \
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@	rb-tray-icon.c \
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_FALSE@	rb-tray-icon.h
+
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_TRUE@ICON_IMPL_FILES = \
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_TRUE@	rb-tray-icon-gtk.h 				\
+@HAVE_APP_INDICATOR_FALSE@@USE_GTK_STATUS_ICON_TRUE@	rb-tray-icon-gtk.c
+
+@HAVE_APP_INDICATOR_TRUE@ICON_IMPL_FILES = \
+@HAVE_APP_INDICATOR_TRUE@	rb-indicator.h					\
+@HAVE_APP_INDICATOR_TRUE@	rb-indicator.c
 
 libstatus_icon_la_SOURCES = \
 	rb-status-icon-plugin.h				\
@@ -382,6 +390,7 @@
 libstatus_icon_la_LIBADD = \
 	$(top_builddir)/shell/librhythmbox-core.la	\
 	$(NOTIFY_LIBS)					\
+	$(APP_INDICATOR_LIBS)				\
 	$(NULL)
 
 INCLUDES = \
@@ -398,6 +407,7 @@
 	-DSHARE_DIR=\"$(pkgdatadir)\"                   \
 	-DDATADIR=\""$(datadir)"\"			\
 	$(RHYTHMBOX_CFLAGS)				\
+	$(APP_INDICATOR_CFLAGS)				\
 	-D_XOPEN_SOURCE -D_BSD_SOURCE
 
 uixmldir = $(plugindir)
@@ -505,6 +515,7 @@
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstatus_icon_la-eggtrayicon.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstatus_icon_la-rb-indicator.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstatus_icon_la-rb-status-icon-plugin.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstatus_icon_la-rb-tray-icon-gtk.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstatus_icon_la-rb-tray-icon.Plo@am__quote@
@@ -565,6 +576,14 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libstatus_icon_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstatus_icon_la-rb-tray-icon-gtk.lo `test -f 'rb-tray-icon-gtk.c' || echo '$(srcdir)/'`rb-tray-icon-gtk.c
 
+libstatus_icon_la-rb-indicator.lo: rb-indicator.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libstatus_icon_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstatus_icon_la-rb-indicator.lo -MD -MP -MF $(DEPDIR)/libstatus_icon_la-rb-indicator.Tpo -c -o libstatus_icon_la-rb-indicator.lo `test -f 'rb-indicator.c' || echo '$(srcdir)/'`rb-indicator.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstatus_icon_la-rb-indicator.Tpo $(DEPDIR)/libstatus_icon_la-rb-indicator.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='rb-indicator.c' object='libstatus_icon_la-rb-indicator.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libstatus_icon_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstatus_icon_la-rb-indicator.lo `test -f 'rb-indicator.c' || echo '$(srcdir)/'`rb-indicator.c
+
 mostlyclean-libtool:
 	-rm -f *.lo
 

=== modified file 'plugins/status-icon/rb-status-icon-plugin.c'
--- old/plugins/status-icon/rb-status-icon-plugin.c	2010-02-03 17:52:33 +0000
+++ new/plugins/status-icon/rb-status-icon-plugin.c	2010-02-03 18:00:36 +0000
@@ -118,7 +118,7 @@
 
 	/* notification data */
 	GdkPixbuf *notify_pixbuf;
-#ifdef HAVE_NOTIFY
+#if defined(HAVE_NOTIFY)
 	NotifyNotification *notification;
 	gboolean notify_supports_actions;
 #endif
@@ -141,14 +141,19 @@
 {
 	{ "MusicClose", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
 	  N_("Hide the music player window"),
-	  G_CALLBACK (toggle_window_cmd) }
+	  G_CALLBACK (toggle_window_cmd) },
+        { "TrayShowWindow", NULL, N_("_Show Rhythmbox"), NULL,
+          N_("Show the music player window"),
+          G_CALLBACK (toggle_window_cmd) }
 };
 
 static GtkToggleActionEntry rb_status_icon_plugin_toggle_entries [] =
 {
+#if 0
 	{ "TrayShowWindow", NULL, N_("_Show Music Player"), NULL,
 	  N_("Choose music to play"),
 	  G_CALLBACK (show_window_cmd) },
+#endif
 	{ "TrayShowNotifications", NULL, N_("Show N_otifications"), NULL,
 	  N_("Show notifications of song changes and other events"),
 	  G_CALLBACK (show_notifications_cmd) },
@@ -284,6 +289,19 @@
 	}
 }
 
+GtkWidget *
+rb_status_icon_get_popup (RBStatusIconPlugin *plugin)
+{
+        GtkWidget *popup;
+        GtkUIManager *uim;
+
+        g_object_get (plugin->priv->shell, "ui-manager", &uim, NULL);
+        popup = gtk_ui_manager_get_widget (GTK_UI_MANAGER (uim),
+                                           "/RhythmboxIndicator");
+
+        return popup;
+}
+
 static void
 sync_actions (RBStatusIconPlugin *plugin)
 {
@@ -295,11 +313,10 @@
 	action = gtk_action_group_get_action (plugin->priv->action_group,
 					      "TrayShowWindow");
 	g_object_get (plugin->priv->shell, "visibility", &visible, NULL);
-	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), visible);
 
 	action = gtk_action_group_get_action (plugin->priv->action_group,
 					      "TrayShowNotifications");
-#ifdef HAVE_NOTIFY
+#if defined(HAVE_NOTIFY)
 	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
 				      plugin->priv->notify_mode != NOTIFY_NEVER);
 #else
@@ -324,7 +341,7 @@
 
 /* notification popups */
 
-#ifdef HAVE_NOTIFY
+#if defined(HAVE_NOTIFY)
 static void
 notification_closed_cb (NotifyNotification *notification,
 			RBStatusIconPlugin *plugin)
@@ -455,10 +472,12 @@
 
 	case ICON_ALWAYS:
 	case ICON_OWNS_WINDOW:
+#ifndef HAVE_APP_INDICATOR
 		if (rb_tray_icon_is_embedded (plugin->priv->tray_icon) == FALSE) {
 			rb_debug ("status icon is not embedded, not notifying");
 			return FALSE;
 		}
+#endif
 		break;
 
 	default:
@@ -488,6 +507,13 @@
 	return TRUE;
 }
 
+#if defined(HAVE_NOTIFY) && defined(HAVE_APP_INDICATOR)
+void
+rb_tray_icon_attach_notification (RBTrayIcon *icon, NotifyNotification *notification)
+{
+}
+#endif
+
 static void
 notify_playing_entry (RBStatusIconPlugin *plugin, gboolean requested)
 {

=== modified file 'plugins/status-icon/rb-status-icon-plugin.h'
--- old/plugins/status-icon/rb-status-icon-plugin.h	2010-02-03 17:52:33 +0000
+++ new/plugins/status-icon/rb-status-icon-plugin.h	2010-02-03 17:59:07 +0000
@@ -72,6 +72,8 @@
 							 GtkTooltip *tooltip,
 							 RBStatusIconPlugin *plugin);
 
+GtkWidget      *rb_status_icon_get_popup                (RBStatusIconPlugin *plugin);
+
 G_END_DECLS
 
 #endif /* __RB_STATUS_ICON_PLUGIN_H */

=== modified file 'plugins/status-icon/status-icon-ui.xml'
--- old/plugins/status-icon/status-icon-ui.xml	2010-02-03 17:52:33 +0000
+++ new/plugins/status-icon/status-icon-ui.xml	2010-02-03 17:59:07 +0000
@@ -22,5 +22,16 @@
       <separator/>
       <menuitem name="QuitTray" action="MusicQuit"/>
   </popup>
+
+  <popup name="RhythmboxIndicator">
+      <menuitem name="PlayTray" action="ControlPlay"/>
+      <separator/>
+      <menuitem name="PreviousTray" action="ControlPrevious"/>
+      <menuitem name="NextTray" action="ControlNext"/>
+      <separator/>
+      <menuitem name="ShowWindowTray" action="TrayShowWindow"/>
+      <menuitem name="QuitTray" action="MusicQuit"/>
+  </popup>
+
 </ui>
 

