diff -ru gtk+.orig\gdk\win32\gdkwindow-win32.c gtk+\gdk\win32\gdkwindow-win32.c
--- gtk+.orig\gdk\win32\gdkwindow-win32.c	Tue Jul 27 15:28:11 2004
+++ gtk+\gdk\win32\gdkwindow-win32.c	Tue Jul 27 15:25:48 2004
@@ -857,6 +857,8 @@
 void
 gdk_window_destroy_notify (GdkWindow *window)
 {
+  HWND hwnd_owner;
+
   g_return_if_fail (window != NULL);
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -864,6 +866,10 @@
 	    g_print ("gdk_window_destroy_notify: %p%s\n",
 		     GDK_WINDOW_HWND (window),
 		     (GDK_WINDOW_DESTROYED (window) ? " (destroyed)" : "")));
+
+  hwnd_owner = GetWindow (GDK_WINDOW_HWND (window), GW_OWNER);
+  if (hwnd_owner)
+    SetActiveWindow (hwnd_owner);
 
   if (!GDK_WINDOW_DESTROYED (window))
     {
