Index: gdkevents-win32.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkevents-win32.c,v
retrieving revision 1.137
diff -u -p -6 -r1.137 gdkevents-win32.c
--- gdkevents-win32.c	3 Sep 2004 01:27:57 -0000	1.137
+++ gdkevents-win32.c	22 Sep 2004 05:34:30 -0000
@@ -561,12 +561,14 @@ gdk_pointer_grab (GdkWindow    *window,
       else
 	return_val = GDK_GRAB_ALREADY_GRABBED;
     }
   
   if (return_val == GDK_GRAB_SUCCESS)
     {
+      POINT pt;
+      GdkEvent *event;
       GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl);
       p_grab_window = window;
 
       if (p_grab_cursor != NULL)
 	{
 	  if (GetCursor () == p_grab_cursor)
@@ -596,34 +598,57 @@ gdk_pointer_grab (GdkWindow    *window,
 	  rect.right = x + width;
 	  rect.bottom = y + height;
 	  API_CALL (ClipCursor, (&rect));
 	  p_grab_confine_to = confine_to;
 	}
 
-      /* FIXME: Generate GDK_CROSSING_GRAB events */
+      /* Generate GDK_CROSSING_GRAB events */
+       GetCursorPos(&pt);
+       ScreenToClient(GDK_WINDOW_HWND (window), &pt);
+       
+       event = gdk_event_new( GDK_ENTER_NOTIFY );
+       event->crossing.window = p_grab_window;
+       event->crossing.subwindow = confine_to;
+       event->crossing.x = pt.x;
+       event->crossing.y = pt.y;
+       event->crossing.time = time;
+       event->crossing.focus = TRUE;
+       append_event( gdk_display_get_default(), event );
     }
   
   return return_val;
 }
 
 void
 gdk_display_pointer_ungrab (GdkDisplay *display,
                             guint32     time)
 {
+  POINT pt;
+  GdkEvent *event;
+
   g_return_if_fail (display == gdk_display_get_default ());
 
   GDK_NOTE (EVENTS, g_print ("%sgdk_display_pointer_ungrab%s",
 			     (debug_indent > 0 ? "\n" : ""),
 			     (debug_indent == 0 ? "\n" : "")));
 
   _gdk_input_ungrab_pointer (time);
 
   if (GetCapture () != NULL)
     ReleaseCapture ();
 
-  /* FIXME: Generate GDK_CROSSING_UNGRAB events */
+  /* Generate GDK_CROSSING_UNGRAB events */
+  GetCursorPos(&pt);
+  ScreenToClient(GDK_WINDOW_HWND (p_grab_window), &pt);
+  event = gdk_event_new( GDK_LEAVE_NOTIFY );
+  event->crossing.window = p_grab_window;
+  event->crossing.x = pt.x;
+  event->crossing.y = pt.y;
+  event->crossing.time = time;
+  event->crossing.focus = FALSE;
+  append_event( display, event );
 
   p_grab_window = NULL;
   if (p_grab_cursor != NULL)
     {
       if (GetCursor () == p_grab_cursor)
 	SetCursor (NULL);
