Index: libwnck/wnckprop.c
===================================================================
--- libwnck/wnckprop.c	(revision 1578)
+++ libwnck/wnckprop.c	(working copy)
@@ -1066,6 +1066,8 @@
   #define wnck_window_keyboard_resize wnck_window_keyboard_size
   SET_PROPERTY (keyboard_resize, WNCK_WINDOW_ACTION_RESIZE)
   SET_PROPERTY_TIMESTAMP (close, WNCK_WINDOW_ACTION_CLOSE)
+  
+  clean_up ();
 }
 
 static void
@@ -1783,7 +1785,7 @@
   gdk_pointer_ungrab (GDK_CURRENT_TIME);
   gdk_keyboard_ungrab (GDK_CURRENT_TIME);
 
-  gtk_main_quit ();
+  g_timeout_add (100, (GSourceFunc)gtk_main_quit, NULL);
 }
 
 int
@@ -1983,7 +1985,10 @@
       if (window)
         {
           if (mode == WINDOW_WRITE_MODE)
-            update_window (window);
+            {
+              update_window (window);
+              gtk_main();
+            }
           else if (mode == WINDOW_READ_MODE)
             print_window (window);
           else
