--- /home/pcjc2/source/gtk+2.0-2.14.4/gdk/win32/gdkevents-win32.c	2008-10-17 05:06:36.000000000 +0100
+++ gdkevents-win32.c	2008-11-23 14:56:17.000000000 +0000
@@ -2243,7 +2243,7 @@
   RECT rect, *drag, orig_drag;
   POINT point;
   MINMAXINFO *mmi;
-  HWND hwnd;
+  HWND hwnd, hwndc;
   HCURSOR hcursor;
   BYTE key_state[256];
   HIMC himc;
@@ -2855,8 +2855,15 @@
       point.x = GET_X_LPARAM (msg->lParam);
       point.y = GET_Y_LPARAM (msg->lParam);
 
-      if ((hwnd = WindowFromPoint (point)) == NULL)
-	break;
+      /* Find our toplevel window */
+      hwnd = GetAncestor (msg->hwnd, GA_ROOT);
+
+      /* Walk back up to the outermost child at the desired point */
+      do {
+        ScreenToClient (hwnd, &point);
+        hwndc = ChildWindowFromPoint (hwnd, point);
+        ClientToScreen (hwnd, &point);
+      } while (hwndc != hwnd && (hwnd = hwndc, 1));
 
       msg->hwnd = hwnd;
       if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL)
