? antiexpose
? p1
? x11/p1
Index: x11/gdkgeometry-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkgeometry-x11.c,v
retrieving revision 1.10
diff -u -p -r1.10 gdkgeometry-x11.c
--- x11/gdkgeometry-x11.c	2001/06/28 05:24:00	1.10
+++ x11/gdkgeometry-x11.c	2001/09/28 17:47:31
@@ -680,7 +680,6 @@ gdk_window_queue_translation (GdkWindow 
   item->u.translate.dx = dx;
   item->u.translate.dy = dy;
 
-  gdk_drawable_ref (window);
   translate_queue = g_slist_append (translate_queue, item);
 }
 
@@ -694,13 +693,44 @@ _gdk_windowing_window_queue_antiexpose (
   item->type = GDK_WINDOW_QUEUE_ANTIEXPOSE;
   item->u.antiexpose.area = area;
 
-  gdk_drawable_ref (window);
   translate_queue = g_slist_append (translate_queue, item);
 
   return TRUE;
 }
 
+static void
+_gdk_window_translate_queue_item_free (GdkWindowQueueItem *item)
+{
+  if (item->type == GDK_WINDOW_QUEUE_ANTIEXPOSE)
+    gdk_region_destroy (item->u.antiexpose.area);
+  
+  g_free (item);
+}
+
 void
+_gdk_window_translate_queue_filter (GdkWindow *window)
+{
+  GSList *elem = translate_queue;
+  GSList *new_queue = 0;
+
+  while (elem)
+    {
+      GdkWindowQueueItem *item = elem->data;
+
+      if (item->window == window)
+	_gdk_window_translate_queue_item_free (item);
+      else
+	new_queue = g_slist_prepend (new_queue, item);
+
+      elem = g_slist_next (elem);
+    }
+
+  g_slist_free (translate_queue);
+
+  translate_queue = g_slist_reverse (new_queue);   // preserve order
+}
+
+void
 _gdk_window_process_expose (GdkWindow    *window,
 			    gulong        serial,
 			    GdkRectangle *area)
@@ -732,12 +762,7 @@ _gdk_window_process_expose (GdkWindow   
 	  GSList *tmp_link = translate_queue;
 	  
 	  translate_queue = g_slist_remove_link (translate_queue, translate_queue);
-	  gdk_drawable_unref (item->window);
-
-	  if (item->type == GDK_WINDOW_QUEUE_ANTIEXPOSE)
-	    gdk_region_destroy (item->u.antiexpose.area);
-	  
-	  g_free (item);
+	  _gdk_window_translate_queue_item_free (item);
 	  g_slist_free_1 (tmp_link);
 	}
     }
Index: x11/gdkprivate-x11.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkprivate-x11.h,v
retrieving revision 1.14
diff -u -p -r1.14 gdkprivate-x11.h
--- x11/gdkprivate-x11.h	2001/09/07 21:50:09	1.14
+++ x11/gdkprivate-x11.h	2001/09/28 17:47:31
@@ -134,6 +134,8 @@ void _gdk_window_process_expose    (GdkW
                                     gulong         serial,
                                     GdkRectangle  *area);
 
+void    _gdk_window_translate_queue_filter (GdkWindow *window);
+
 void     _gdk_selection_window_destroyed   (GdkWindow            *window);
 gboolean _gdk_selection_filter_clear_event (XSelectionClearEvent *event);
 
Index: x11/gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.126
diff -u -p -r1.126 gdkwindow-x11.c
--- x11/gdkwindow-x11.c	2001/09/19 22:09:17	1.126
+++ x11/gdkwindow-x11.c	2001/09/28 17:47:32
@@ -737,6 +737,8 @@ gdk_window_destroy_notify (GdkWindow *wi
 
   g_return_if_fail (window != NULL);
   
+  _gdk_window_translate_queue_filter (window);
+
   window_impl = GDK_WINDOW_IMPL_X11 (((GdkWindowObject *)window)->impl);
 
   if (!GDK_WINDOW_DESTROYED (window))
