--- InitOutput.c.orig	Sat Jun  8 04:19:20 2002
+++ InitOutput.c	Wed Jun 12 21:24:27 2002
@@ -90,6 +90,7 @@
       g_ScreenInfo[i].pfb = NULL;
       g_ScreenInfo[i].fFullScreen = FALSE;
       g_ScreenInfo[i].fDecoration = TRUE;
+      g_ScreenInfo[i].fHideWindowsPointerWhenInactive = FALSE;
       g_ScreenInfo[i].iE3BTimeout = WIN_E3B_OFF;
       g_ScreenInfo[i].dwWidth_mm = (dwWidth / WIN_DEFAULT_DPI)
 	* 25.4;
@@ -204,6 +205,11 @@
 	  "\tEmulate 3 button mouse with an optional timeout in "
 	  "milliseconds\n");
 
+  ErrorF ("-hidewindowspointerwheninactive\n"
+          "\tHide the windows mouse pointer when it is over an inactive "
+          "Xfree86 window.  This prevents ghost cursors appearing where the "
+          "Windows cursor is draw over the X cursor\n");
+
   ErrorF ("-engine engine_type_id\n"
 	  "\tOverride the server's automatically selected engine type:\n"
 	  "\t\t1 - Shadow GDI\n"
@@ -434,6 +440,32 @@
 	{
 	  /* Parameter is for a single screen */
 	  g_ScreenInfo[g_iLastScreen].fFullScreen = TRUE;
+	}
+
+      /* Indicate that we have processed this argument */
+      return 1;
+    }
+
+  /*
+   * Look for the '-hidewindowspointerwheninactive' argument
+   */
+  if (strcmp(argv[i], "-hidewindowspointerwheninactive") == 0)
+    {
+      /* Is this parameter attached to a screen or is it global? */
+      if (-1 == g_iLastScreen)
+	{
+	  int			j;
+
+	  /* Parameter is for all screens */
+	  for (j = 0; j < MAXSCREENS; j++)
+	    {
+	      g_ScreenInfo[j].fHideWindowsPointerWhenInactive = TRUE;
+	    }
+	}
+      else
+	{
+	  /* Parameter is for a single screen */
+          g_ScreenInfo[g_iLastScreen].fHideWindowsPointerWhenInactive = TRUE;
 	}
 
       /* Indicate that we have processed this argument */
--- XWin.man.orig	Sat Jun  8 04:49:56 2002
+++ XWin.man	Wed Jun 12 21:24:27 2002
@@ -50,6 +50,9 @@
 .B \-nodecoration
 Draw the Cygwin/XFree86 window without a border or title bar.
 .TP 8
+.B \-fHideWindowsPointerWhenInactive
+Hide the windows mouse pointer when the mouse is over an inactive XFree86 window
+.TP 8
 .B \-[no]unixkill
 Ctrl+Alt+Backspace exits the X Server
 .TP 8
--- win.h.orig	Sun Jun  9 02:24:23 2002
+++ win.h	Wed Jun 12 21:24:27 2002
@@ -330,6 +330,7 @@
   DWORD			dwEnginesSupported;
   Bool			fFullScreen;
   Bool			fDecoration;
+  Bool			fHideWindowsPointerWhenInactive;
   int			iE3BTimeout;
   /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */
   Bool                  fUseWinKillKey;
--- winwndproc.c.orig	Sun Jun  9 02:46:26 2002
+++ winwndproc.c	Wed Jun 12 22:54:25 2002
@@ -164,13 +164,13 @@
 			       GET_Y_LPARAM(lParam));
 
       /* Hide or show the Windows mouse cursor */
-      if (fCursor && pScreenPriv->fActive)
+      if (fCursor && (pScreenPriv->fActive || pScreenInfo->fHideWindowsPointerWhenInactive))
 	{
 	  /* Hide Windows cursor */
 	  fCursor = FALSE;
 	  ShowCursor (FALSE);
 	}
-      else if (!fCursor && !pScreenPriv->fActive)
+      else if (!fCursor && !pScreenPriv->fActive && !pScreenInfo->fHideWindowsPointerWhenInactive)
 	{
 	  /* Show Windows cursor */
 	  fCursor = TRUE;
@@ -427,7 +427,7 @@
 	  ShowCursor (FALSE);
 	}
       else if (LOWORD(wParam) == WA_INACTIVE
-	       && !fCursor)
+	       && !fCursor && !pScreenInfo->fHideWindowsPointerWhenInactive)
 	{
 	  /* Show Windows cursor */
 	  fCursor = TRUE;
@@ -454,7 +454,7 @@
 	  ShowCursor (FALSE);
 	}
       else if (!pScreenPriv->fActive
-	       && !fCursor)
+	       && !fCursor && !pScreenInfo->fHideWindowsPointerWhenInactive)
 	{
 	  /* Show Windows cursor */
 	  fCursor = TRUE;
