--- gtk+-2.2.1.orig/gdk/win32/gdkevents-win32.c	2003-01-21 17:44:47.000000000 -0500
+++ gtk+-2.2.1/gdk/win32/gdkevents-win32.c	2003-07-29 19:02:48.000000000 -0400
@@ -108,6 +108,7 @@
 static GdkEventMask p_grab_mask;
 static gboolean p_grab_owner_events, k_grab_owner_events;
 static HCURSOR p_grab_cursor;
+static gboolean resizing = FALSE;
 
 static GSourceFuncs event_funcs = {
   gdk_event_prepare,
@@ -3130,44 +3131,63 @@
 	}
       break;
 
-#if 0 /* Not quite right, otherwise it may be faster/better than
-       * WM_(MOVE|SIZE) remove decoration (frame) sizes ?
-       */
-    case WM_WINDOWPOSCHANGED :
-
-      if (!(private->event_mask & GDK_STRUCTURE_MASK))
-	break;
-
-      if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD
-	  && !IsIconic (msg->hwnd)
-          && IsWindowVisible (msg->hwnd))
-	{
-	  LPWINDOWPOS lpwp = (LPWINDOWPOS) (msg->lParam);
+    case WM_ENTERSIZEMOVE:
+            resizing = TRUE;
+            break;
+
+    case WM_EXITSIZEMOVE:
+            resizing = FALSE;
+            break;
 
-	  event->configure.type = GDK_CONFIGURE;
-	  event->configure.window = window;
-	  event->configure.x = lpwp->x;
-	  event->configure.y = lpwp->y;
-	  event->configure.width = lpwp->cx;
-	  event->configure.height = lpwp->cy;
-	  private->x = event->configure.x;
-	  private->y = event->configure.y;
-	  GDK_WINDOW_IMPL_WIN32 (private->impl)->width = event->configure.width;
-	  GDK_WINDOW_IMPL_WIN32 (private->impl)->height = event->configure.height;
-	  
-	  return_val = !GDK_WINDOW_DESTROYED (window);
-
-          GDK_NOTE (EVENTS, g_print ("WM_WINDOWPOSCHANGED: %p  %ldx%ld@+%ld+%ld\n",
-				     msg->hwnd,
-				     lpwp->cx, lpwp->cy, lpwp->x, lpwp->y));
+    case WM_WINDOWPOSCHANGED :
+            /* Once we've entered the moving or sizing modal loop, we won't
+               return to the main loop until we're done sizing or moving. */
+            if(resizing) {
+                    if (!(private->event_mask & GDK_STRUCTURE_MASK))
+                            break;
+                    if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD
+                        && !IsIconic (msg->hwnd)
+                        && IsWindowVisible (msg->hwnd)) {
+                            GdkEvent evnt;
+                            RECT rect;
+
+                            evnt.configure.type = GDK_CONFIGURE;
+                            evnt.configure.window = window;
+                            pt.x = 0;
+                            pt.y = 0;
+                            ClientToScreen (msg->hwnd, &pt);
+                            GetClientRect(msg->hwnd, &rect);
+                            evnt.configure.x = pt.x;
+                            evnt.configure.y = pt.y;
+                            evnt.configure.width = rect.right - rect.left;
+                            evnt.configure.height = rect.bottom - rect.top;
+
+                            private->x = evnt.configure.x;
+                            private->y = evnt.configure.y;
+                            GDK_WINDOW_IMPL_WIN32 (private->impl)->width = evnt.configure.width;
+                            GDK_WINDOW_IMPL_WIN32 (private->impl)->height = evnt.configure.height;
+
+                            if (private->resize_count > 1)
+                                    private->resize_count -= 1;
+
+                            /* Dispatch it now */
+                            if (_gdk_event_func)
+                                    (*_gdk_event_func) (&evnt, _gdk_event_data);
+
+                            /* We just dispached our own event.. so don't when we return */
+                            return_val = FALSE;
+
+                            /* dispatch main loop - to realize resizes..*/
+                            while (g_main_context_pending (NULL))
+                                    g_main_context_iteration (NULL, FALSE);
+
+                            /* claim as handled, so that WM_SIZE and WM_MOVE are avoided */
+                            *ret_val_flagp = TRUE;
+                            *ret_valp = 1;
+                    }
+            }
+            break;
 
-	  if (ret_val_flagp)
-	    *ret_val_flagp = TRUE;
-	  if (ret_valp)
-	    *ret_valp = 0;
-	}
-      break;
-#endif
     case WM_CLOSE:
       GDK_NOTE (EVENTS, g_print ("WM_CLOSE: %p\n", msg->hwnd));
 
