Index: gdkevents-win32.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkevents-win32.c,v
retrieving revision 1.100.2.17
diff -u -2 -r1.100.2.17 gdkevents-win32.c
--- gdkevents-win32.c	25 Sep 2003 18:42:14 -0000	1.100.2.17
+++ gdkevents-win32.c	13 Oct 2003 00:57:51 -0000
@@ -85,6 +85,5 @@
 static gboolean  gdk_event_translate	(GdkDisplay *display,
 					 MSG	    *msg,
-					 gint       *ret_valp,
-					 gboolean    return_exposes);
+					 gint       *ret_valp);
 static void      handle_wm_paint        (MSG        *msg,
 					 GdkWindow  *window,
@@ -146,4 +146,6 @@
 
 static gboolean in_ime_composition = FALSE;
+static gboolean resizing = FALSE;
+static UINT_PTR resize_timer;
 
 static void
@@ -237,5 +239,5 @@
   msg.pt.y = GET_Y_LPARAM (pos);
 
-  if (gdk_event_translate (display, &msg, &ret_val, FALSE))
+  if (gdk_event_translate (display, &msg, &ret_val))
     {
       /* If gdk_event_translate() returns TRUE, we return ret_val from
@@ -1984,9 +1989,30 @@
 }
 
+static void
+handle_stuff_while_moving_or_resizing (void)
+{
+  int arbitrary_limit = 1;
+  while (g_main_pending () && arbitrary_limit--)
+    g_main_iteration (FALSE);
+}
+
+static VOID CALLBACK
+resize_timer_proc (HWND     hwnd,
+		   UINT     msg,
+		   UINT_PTR id,
+		   DWORD    time)
+{
+  if (resizing)
+    {
+      GDK_NOTE (EVENTS, g_print ("resize_timer_proc\n"));
+
+      handle_stuff_while_moving_or_resizing ();
+    }
+}
+
 static gboolean
 gdk_event_translate (GdkDisplay *display,
-		     MSG      *msg,
-		     gint     *ret_valp,
-		     gboolean  return_exposes)
+		     MSG        *msg,
+		     gint       *ret_valp)
 {
   DWORD pidActWin;
@@ -2929,4 +2960,75 @@
 
 	  return_val = TRUE;
+	}
+      break;
+
+    case WM_ENTERSIZEMOVE:
+      resizing = TRUE;
+      resize_timer = SetTimer (NULL, 0, 20, resize_timer_proc);
+      break;
+
+    case WM_EXITSIZEMOVE:
+      resizing = FALSE;
+      KillTimer (NULL, resize_timer);
+      break;
+
+    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.
+       */
+      GDK_NOTE (EVENTS, g_print ("WM_WINDOWPOSCHANGED: %p\n", msg->hwnd));
+
+      if (resizing &&
+	 GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&
+	 !GDK_WINDOW_DESTROYED (window))
+	{
+	  RECT client_rect;
+
+	  GetClientRect (msg->hwnd, &client_rect);
+  
+	  GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->width = client_rect.right - client_rect.left;
+	  GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl)->height = client_rect.bottom - client_rect.top;
+	  
+	  ((GdkWindowObject *) window)->x = client_rect.left;
+	  ((GdkWindowObject *) window)->y = client_rect.top;
+	  
+	  if (((GdkWindowObject *) window)->event_mask & GDK_STRUCTURE_MASK)
+	    {
+	      POINT point;
+	      GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
+	      
+	      point.x = point.y = 0;
+	      ClientToScreen (msg->hwnd, &point);
+	      
+	      event->configure.window = window;
+	      
+	      event->configure.width = client_rect.right - client_rect.left;
+	      event->configure.height = client_rect.bottom - client_rect.top;
+	      
+	      event->configure.x = point.x;
+	      event->configure.y = point.y;
+	      
+	      if (gdk_window_get_parent (window) == _gdk_parent_root)
+		{
+		  event->configure.x += _gdk_offset_x;
+		  event->configure.y += _gdk_offset_y;
+		}
+	      
+	      if (((GdkWindowObject *) window)->resize_count > 1)
+		((GdkWindowObject *) window)->resize_count -= 1;
+	      
+	      /* Dispatch it now */
+	      fixup_event (event);
+	      if (_gdk_event_func)
+		(*_gdk_event_func) (event, _gdk_event_data);
+	      gdk_event_free (event);
+	      
+	      /* Dispatch main loop - to realize resizes... */
+	      handle_stuff_while_moving_or_resizing ();
+	      
+	      /* Claim as handled, so that WM_SIZE and WM_MOVE are avoided */
+	      return_val = TRUE;
+	      *ret_valp = 1;
+	    }
 	}
       break;
