diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
index dab6ff6..ccb5f9e 100644
--- a/gtk/gtkstatusicon.c
+++ b/gtk/gtkstatusicon.c
@@ -170,6 +170,8 @@ static void     gtk_status_icon_screen_changed   (GtkStatusIcon  *status_icon,
 						  GdkScreen      *old_screen);
 static void     gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon);
 static void     gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon);
+static void     gtk_status_icon_fg_changed (GtkStatusIcon *status_icon);
+static void     gtk_status_icon_bg_changed (GtkStatusIcon *status_icon);
 static gboolean gtk_status_icon_scroll           (GtkStatusIcon  *status_icon,
 						  GdkEventScroll *event);
 static gboolean gtk_status_icon_query_tooltip    (GtkStatusIcon *status_icon,
@@ -827,7 +829,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
   priv = G_TYPE_INSTANCE_GET_PRIVATE (status_icon, GTK_TYPE_STATUS_ICON,
 				      GtkStatusIconPrivate);
   status_icon->priv = priv;
-  
+
   priv->storage_type = GTK_IMAGE_EMPTY;
   priv->visible      = TRUE;
 
@@ -850,6 +852,10 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
 			    G_CALLBACK (gtk_status_icon_embedded_changed), status_icon);
   g_signal_connect_swapped (priv->tray_icon, "notify::orientation",
 			    G_CALLBACK (gtk_status_icon_orientation_changed), status_icon);
+  g_signal_connect_swapped (priv->tray_icon, "notify::fg-color",
+                            G_CALLBACK (gtk_status_icon_fg_changed), status_icon);
+  g_signal_connect_swapped (priv->tray_icon, "notify::bg-color",
+                            G_CALLBACK (gtk_status_icon_bg_changed), status_icon);
   g_signal_connect_swapped (priv->tray_icon, "button-press-event",
 			    G_CALLBACK (gtk_status_icon_button_press), status_icon);
   g_signal_connect_swapped (priv->tray_icon, "button-release-event",
@@ -975,6 +981,10 @@ gtk_status_icon_finalize (GObject *object)
   g_signal_handlers_disconnect_by_func (priv->tray_icon,
 			                gtk_status_icon_orientation_changed, status_icon);
   g_signal_handlers_disconnect_by_func (priv->tray_icon,
+                                        gtk_status_icon_fg_changed, status_icon);
+  g_signal_handlers_disconnect_by_func (priv->tray_icon,
+                                        gtk_status_icon_bg_changed, status_icon);
+  g_signal_handlers_disconnect_by_func (priv->tray_icon,
 			                gtk_status_icon_button_press, status_icon);
   g_signal_handlers_disconnect_by_func (priv->tray_icon,
 			                gtk_status_icon_button_release, status_icon);
@@ -1690,6 +1700,26 @@ gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon)
   g_object_notify (G_OBJECT (status_icon), "orientation");
 }
 
+static void
+gtk_status_icon_fg_changed (GtkStatusIcon *status_icon)
+{
+  GtkStatusIconPrivate *priv = status_icon->priv;
+
+  gtk_widget_modify_fg (priv->image,
+                        GTK_STATE_NORMAL,
+                        _gtk_tray_icon_get_fg_color (GTK_TRAY_ICON (priv->tray_icon)));
+}
+
+static void
+gtk_status_icon_bg_changed (GtkStatusIcon *status_icon)
+{
+  GtkStatusIconPrivate *priv = status_icon->priv;
+
+  gtk_widget_modify_bg (priv->image,
+                        GTK_STATE_NORMAL,
+                        _gtk_tray_icon_get_bg_color (GTK_TRAY_ICON (priv->tray_icon)));
+}
+
 static gboolean
 gtk_status_icon_key_press (GtkStatusIcon  *status_icon,
 			   GdkEventKey    *event)
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
index 49fd86a..d9e69b7 100644
--- a/gtk/gtktrayicon-x11.c
+++ b/gtk/gtktrayicon-x11.c
@@ -43,7 +43,9 @@
 
 enum {
   PROP_0,
-  PROP_ORIENTATION
+  PROP_ORIENTATION,
+  PROP_FG_COLOR,
+  PROP_BG_COLOR
 };
 
 struct _GtkTrayIconPrivate
@@ -55,11 +57,14 @@ struct _GtkTrayIconPrivate
   Atom system_tray_opcode_atom;
   Atom orientation_atom;
   Atom visual_atom;
+  Atom colors_atom;
   Window manager_window;
   GdkVisual *manager_visual;
   gboolean manager_visual_rgba;
 
   GtkOrientation orientation;
+  GdkColor fg_color;
+  GdkColor bg_color;
 };
 
 static void gtk_tray_icon_constructed   (GObject     *object);
@@ -75,7 +80,7 @@ static void     gtk_tray_icon_style_set (GtkWidget   *widget,
 					 GtkStyle    *previous_style);
 static gboolean gtk_tray_icon_delete    (GtkWidget   *widget,
 					 GdkEventAny *event);
-static gboolean gtk_tray_icon_expose    (GtkWidget      *widget, 
+static gboolean gtk_tray_icon_expose    (GtkWidget      *widget,
 					 GdkEventExpose *event);
 
 static void gtk_tray_icon_clear_manager_window     (GtkTrayIcon *icon);
@@ -113,6 +118,22 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class)
 						      GTK_ORIENTATION_HORIZONTAL,
 						      GTK_PARAM_READABLE));
 
+  g_object_class_install_property (gobject_class,
+                                   PROP_FG_COLOR,
+                                   g_param_spec_boxed ("fg-color",
+                                                       P_("Foreground color"),
+                                                       P_("Foreground color for symbolic icons"),
+                                                       GDK_TYPE_COLOR,
+                                                       GTK_PARAM_READABLE));
+
+  g_object_class_install_property (gobject_class,
+                                   PROP_BG_COLOR,
+                                   g_param_spec_boxed ("bg-color",
+                                                       P_("Background color"),
+                                                       P_("Background color for symbolic icons"),
+                                                       GDK_TYPE_COLOR,
+                                                       GTK_PARAM_READABLE));
+
   g_type_class_add_private (class, sizeof (GtkTrayIconPrivate));
 }
 
@@ -121,9 +142,15 @@ gtk_tray_icon_init (GtkTrayIcon *icon)
 {
   icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, GTK_TYPE_TRAY_ICON,
 					    GtkTrayIconPrivate);
-  
+
   icon->priv->stamp = 1;
   icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
+  icon->priv->fg_color.red = 0;
+  icon->priv->fg_color.green = 0;
+  icon->priv->fg_color.blue = 0;
+  icon->priv->bg_color.red = 0xffff;
+  icon->priv->bg_color.green = 0xffff;
+  icon->priv->bg_color.blue = 0xffff;
 
   gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE);
   gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
@@ -161,6 +188,10 @@ gtk_tray_icon_constructed (GObject *object)
 					 "_NET_SYSTEM_TRAY_VISUAL",
 					 False);
 
+  icon->priv->colors_atom = XInternAtom (xdisplay,
+                                         "_NET_SYSTEM_TRAY_COLORS",
+                                         False);
+
   /* Add a root window filter so that we get changes on MANAGER */
   gdk_window_add_filter (root_window,
 			 gtk_tray_icon_manager_filter, icon);
@@ -212,6 +243,12 @@ gtk_tray_icon_get_property (GObject    *object,
     case PROP_ORIENTATION:
       g_value_set_enum (value, icon->priv->orientation);
       break;
+    case PROP_FG_COLOR:
+      g_value_set_boxed (value, &icon->priv->fg_color);
+      break;
+    case PROP_BG_COLOR:
+      g_value_set_boxed (value, &icon->priv->bg_color);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -372,9 +409,78 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
     XFree (prop.prop);
 }
 
+static void
+gtk_tray_icon_get_colors_property (GtkTrayIcon *icon)
+{
+  GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon));
+  GdkDisplay *display = gdk_screen_get_display (screen);
+  Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
+
+  Atom type;
+  int format;
+  union {
+        gulong *prop;
+        guchar *prop_ch;
+  } prop = { NULL };
+  gulong nitems;
+  gulong bytes_after;
+  int error, result;
+
+  g_assert (icon->priv->manager_window != None);
+
+  g_print ("colors property changed\n");
+  gdk_error_trap_push ();
+  type = None;
+  result = XGetWindowProperty (xdisplay,
+			       icon->priv->manager_window,
+			       icon->priv->colors_atom,
+			       0, G_MAXLONG, FALSE,
+			       XA_CARDINAL,
+			       &type, &format, &nitems,
+			       &bytes_after, &(prop.prop_ch));
+  error = gdk_error_trap_pop ();
+
+  if (error || result != Success)
+    return;
+
+  if (type == XA_CARDINAL && nitems == 6 && format == 32)
+    {
+      GdkColor color;
+
+      g_object_freeze_notify (G_OBJECT (icon));
+
+      color.red = prop.prop[0];
+      color.green = prop.prop[1];
+      color.blue = prop.prop[2];
+
+      if (!gdk_color_equal (&icon->priv->fg_color, &color))
+        {
+          icon->priv->fg_color = color;
+
+          g_object_notify (G_OBJECT (icon), "fg-color");
+        }
+
+      color.red = prop.prop[3];
+      color.green = prop.prop[4];
+      color.blue = prop.prop[5];
+
+      if (!gdk_color_equal (&icon->priv->bg_color, &color))
+        {
+          icon->priv->bg_color = color;
+
+          g_object_notify (G_OBJECT (icon), "bg-color");
+        }
+
+      g_object_thaw_notify (G_OBJECT (icon));
+    }
+
+  if (type != None)
+    XFree (prop.prop);
+}
+
 static GdkFilterReturn
-gtk_tray_icon_manager_filter (GdkXEvent *xevent, 
-			      GdkEvent  *event, 
+gtk_tray_icon_manager_filter (GdkXEvent *xevent,
+			      GdkEvent  *event,
 			      gpointer   user_data)
 {
   GtkTrayIcon *icon = user_data;
@@ -399,6 +505,14 @@ gtk_tray_icon_manager_filter (GdkXEvent *xevent,
 
 	  gtk_tray_icon_get_orientation_property (icon);
 	}
+      else if (xev->xany.type == PropertyNotify &&
+               xev->xproperty.atom == icon->priv->colors_atom)
+        {
+          GTK_NOTE (PLUGSOCKET,
+                    g_print ("GtkStatusIcon %p: got PropertyNotify on manager window for colors atom\n", icon));
+
+          gtk_tray_icon_get_colors_property (icon);
+        }
       else if (xev->xany.type == DestroyNotify)
 	{
           GTK_NOTE (PLUGSOCKET,
@@ -501,9 +615,11 @@ gtk_tray_icon_update_manager_window (GtkTrayIcon *icon)
 					      icon->priv->manager_window);
       
       gdk_window_add_filter (gdkwin, gtk_tray_icon_manager_filter, icon);
+      g_print ("manager window %d\n", icon->priv->manager_window);
 
       gtk_tray_icon_get_orientation_property (icon);
       gtk_tray_icon_get_visual_property (icon);
+      gtk_tray_icon_get_colors_property (icon);
 
       if (gtk_widget_get_realized (GTK_WIDGET (icon)))
 	{
@@ -740,6 +856,21 @@ _gtk_tray_icon_get_orientation (GtkTrayIcon *icon)
   return icon->priv->orientation;
 }
 
+const GdkColor *
+_gtk_tray_icon_get_fg_color (GtkTrayIcon *icon)
+{
+  g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), NULL);
+
+  return &icon->priv->fg_color;
+}
+
+const GdkColor *
+_gtk_tray_icon_get_bg_color (GtkTrayIcon *icon)
+{
+  g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), NULL);
+
+  return &icon->priv->bg_color;
+}
 
 #define __GTK_TRAY_ICON_X11_C__
 #include "gtkaliasdef.c"
diff --git a/gtk/gtktrayicon.h b/gtk/gtktrayicon.h
index 4c1e184..e122199 100644
--- a/gtk/gtktrayicon.h
+++ b/gtk/gtktrayicon.h
@@ -69,7 +69,10 @@ void           _gtk_tray_icon_cancel_message  (GtkTrayIcon *icon,
 					       guint        id);
 
 GtkOrientation _gtk_tray_icon_get_orientation (GtkTrayIcon *icon);
-					    
+
+G_CONST_RETURN GdkColor *_gtk_tray_icon_get_fg_color (GtkTrayIcon *icon);
+G_CONST_RETURN GdkColor *_gtk_tray_icon_get_bg_color (GtkTrayIcon *icon);
+
 G_END_DECLS
 
 #endif /* __GTK_TRAY_ICON_H__ */
