--- gdkevents-win32.c.orig	2004-11-12 05:53:11.000000000 +0800
+++ gdkevents-win32.c	2004-12-30 23:27:34.000000000 +0800
@@ -3355,6 +3355,19 @@ gdk_event_translate (GdkDisplay *display
       handle_display_change ();
       break;
       
+    case WM_DESTROYCLIPBOARD:
+      if (_gdk_selection_filter_clear_event ())
+	{
+	  event = gdk_event_new (GDK_SELECTION_CLEAR);
+	  event->selection.window = window;
+	  event->selection.selection = GDK_SELECTION_CLIPBOARD;
+	  event->selection.time = _gdk_win32_get_next_tick (msg->time);
+          append_event (display, event);
+	}
+      else
+	return_val = TRUE;
+
+      break;
 
 #ifdef HAVE_WINTAB
       /* Handle WINTAB events here, as we know that gdkinput.c will
--- gdkprivate-win32.h.orig	2004-12-30 23:26:14.000000000 +0800
+++ gdkprivate-win32.h	2004-12-30 23:27:39.000000000 +0800
@@ -364,6 +364,7 @@ void	_gdk_win32_get_adjusted_client_rect
 					     RECT      *RECT);
 
 void    _gdk_selection_property_delete (GdkWindow *);
+gboolean _gdk_selection_filter_clear_event ();
 
 void    _gdk_dropfiles_store (gchar *data);
 
--- gdkselection-win32.c.orig	2004-07-07 08:15:27.000000000 +0800
+++ gdkselection-win32.c	2004-12-30 23:34:58.000000000 +0800
@@ -194,6 +194,20 @@ _gdk_dropfiles_store (gchar *data)
     }
 }
 
+static gboolean clear_event_filter_pass = TRUE;
+
+static gboolean
+_gdk_selection_set_clear_event_filter_pass (gboolean pass)
+{
+  clear_event_filter_pass = pass;
+}
+
+gboolean
+_gdk_selection_filter_clear_event ()
+{
+  return clear_event_filter_pass;
+}
+
 gboolean
 gdk_selection_owner_set_for_display (GdkDisplay *display,
                                      GdkWindow  *owner,
@@ -238,11 +252,14 @@ gdk_selection_owner_set_for_display (Gdk
   if (!API_CALL (OpenClipboard, (hwnd)))
     return FALSE;
 
+  _gdk_selection_set_clear_event_filter_pass (FALSE);
   if (!API_CALL (EmptyClipboard, ()))
     {
+      _gdk_selection_set_clear_event_filter_pass (TRUE);
       API_CALL (CloseClipboard, ());
       return FALSE;
     }
+  _gdk_selection_set_clear_event_filter_pass (TRUE);
 #if 0
   /* No delayed rendering */
   if (hwnd != NULL)
@@ -634,7 +651,7 @@ gdk_selection_send_notify_for_display (G
    * return NULL for CLIPBOARD, it works. Sigh.
    */
 
-  tmp_event.selection.type = GDK_SELECTION_CLEAR;
+  /* tmp_event.selection.type = GDK_SELECTION_CLEAR;
   tmp_event.selection.window = gdk_window_lookup (requestor);
   tmp_event.selection.send_event = FALSE;
   tmp_event.selection.selection = selection;
@@ -643,7 +660,7 @@ gdk_selection_send_notify_for_display (G
   tmp_event.selection.requestor = 0;
   tmp_event.selection.time = time;
 
-  gdk_event_put (&tmp_event);
+  gdk_event_put (&tmp_event); */
 }
 
 /* It's hard to say whether implementing this actually is of any use
