Index: gtk/gtkplug-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkplug-x11.c,v
retrieving revision 1.2
diff -u -r1.2 gtkplug-x11.c
--- gtk/gtkplug-x11.c	13 Sep 2005 19:57:41 -0000	1.2
+++ gtk/gtkplug-x11.c	16 Mar 2006 21:50:39 -0000
@@ -33,6 +33,7 @@
 #include "gtkplugprivate.h"
 
 #include "x11/gdkx.h"
+#include "gdkprivate.h"
 
 #include "gtkxembed.h"
 
@@ -60,7 +61,8 @@
 void
 _gtk_plug_windowing_unmap_toplevel (GtkPlug *plug)
 {
-  xembed_set_info (GTK_WIDGET (plug)->window, 0);
+  if (!GDK_WINDOW_DESTROYED (GTK_WIDGET (plug)->window))
+    xembed_set_info (GTK_WIDGET (plug)->window, 0);
 }
 
 void
Index: gtk/gtktrayicon-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktrayicon-x11.c,v
retrieving revision 1.3
diff -u -r1.3 gtktrayicon-x11.c
--- gtk/gtktrayicon-x11.c	27 Feb 2006 16:48:34 -0000	1.3
+++ gtk/gtktrayicon-x11.c	16 Mar 2006 21:50:39 -0000
@@ -87,6 +87,7 @@
   widget_class->realize   = gtk_tray_icon_realize;
   widget_class->unrealize = gtk_tray_icon_unrealize;
   widget_class->delete_event = gtk_tray_icon_delete;
+  widget_class->destroy_event = gtk_tray_icon_delete;
 
   g_object_class_install_property (gobject_class,
 				   PROP_ORIENTATION,
@@ -348,6 +349,17 @@
       gdk_window_remove_filter (gdkwin, gtk_tray_icon_manager_filter, icon);
       
       icon->priv->manager_window = None;
+    }
+
+  if (GTK_WIDGET_REALIZED (widget))
+    {
+      gboolean visible = GTK_WIDGET_VISIBLE (widget);
+
+      if (visible)
+	gtk_widget_hide (widget);
+      gtk_widget_unrealize (widget);
+      if (visible)
+	gtk_widget_show (widget);
     }
 
   gtk_tray_icon_update_manager_window (icon, TRUE);  
Index: gdk/x11/gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.256
diff -u -r1.256 gdkwindow-x11.c
--- gdk/x11/gdkwindow-x11.c	20 Feb 2006 01:36:49 -0000	1.256
+++ gdk/x11/gdkwindow-x11.c	16 Mar 2006 20:07:59 -0000
@@ -1139,7 +1139,14 @@
   if (toplevel)
     gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
 
+  if (foreign_destroy)
+    gdk_error_trap_push ();
   _gdk_x11_drawable_finish (private->impl);
+  if (foreign_destroy)
+    {
+      gdk_display_sync (GDK_WINDOW_DISPLAY (window));
+      gdk_error_trap_pop ();
+    }
 
   if (!recursing && !foreign_destroy)
     {
@@ -1150,7 +1157,7 @@
 void
 _gdk_windowing_window_destroy_foreign (GdkWindow *window)
 {
-  /* It's somebody else's window, but in our heirarchy,
+  /* It's somebody else's window, but in our hierarchy,
    * so reparent it to the root window, and then send
    * it a delete event, as if we were a WM
    */
Index: tests/teststatusicon.c
===================================================================
RCS file: /cvs/gnome/gtk+/tests/teststatusicon.c,v
retrieving revision 1.3
diff -u -r1.3 teststatusicon.c
--- tests/teststatusicon.c	3 Nov 2005 12:09:49 -0000	1.3
+++ tests/teststatusicon.c	16 Mar 2006 21:50:39 -0000
@@ -41,7 +41,7 @@
   if (status == TEST_STATUS_INFO)
     {
       icon_name = GTK_STOCK_DIALOG_INFO;
-      tooltip = "Some Infromation ...";
+      tooltip = "Some Information ...";
     }
   else
     {
