--- dlls/x11drv/event.c.unpatched	2004-07-31 01:07:41.000000000 +0100
+++ dlls/x11drv/event.c	2004-07-31 01:08:23.000000000 +0100
@@ -112,7 +112,7 @@
 static int DGAKeyPressEventType;
 static int DGAKeyReleaseEventType;
 
-static BOOL DGAUsed = FALSE;
+BOOL DGAUsed = FALSE;
 static HWND DGAhwnd = 0;
 
 extern void X11DRV_DGAMotionEvent( HWND hwnd, XDGAMotionEvent *event );
@@ -133,18 +133,40 @@
     XEvent event;
     int count = 0;
 
+    /* Added to make starcraft work */
+#ifdef HAVE_LIBXXF86DGA2
+    Display *display = DGAUsed ? gdi_display : data->display;
+#else
+    Display *display = data->display;
+#endif
+
     wine_tsx11_lock();
-    while ( XPending( data->display ) )
+    /* Changed to make starcraft work */
+    while ( XPending( display ) )
     {
-        Bool ignore;
-
-        XNextEvent( data->display, &event );
-        ignore = XFilterEvent( &event, None );
+        XNextEvent( display, &event );
         wine_tsx11_unlock();
-        if (!ignore) EVENT_ProcessEvent( &event );
+        EVENT_ProcessEvent( &event );
         count++;
         wine_tsx11_lock();
     }
+/* this is a way in old patch, but I think it is unecessary
+   not sure why we need a separate loop
+
+    int events;
+    while ( (events = XPending( display )) )
+    {
+        do
+        {
+            XNextEvent( display, &event );
+            wine_tsx11_unlock();
+            EVENT_ProcessEvent( &event );
+            count++;
+            wine_tsx11_lock();
+        }
+        while ( --events != 0);
+    }
+*/
     wine_tsx11_unlock();
     return count;
 }
--- dlls/x11drv/mouse.c.unpatched	2004-07-31 01:07:34.000000000 +0100
+++ dlls/x11drv/mouse.c	2004-07-31 01:11:52.000000000 +0100
@@ -37,6 +37,10 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(cursor);
 
+#ifdef HAVE_LIBXXF86DGA2
+extern BOOL DGAUsed;
+#endif
+
 /**********************************************************************/
 
 #define NB_BUTTONS   5     /* Windows can handle 3 buttons and the wheel too */
@@ -161,9 +165,14 @@
 
     if (data->cursor_window != win)
     {
+#ifdef HAVE_LIBXXF86DGA2
+        Display *display = DGAUsed ? gdi_display : data->display;
+#else
+        Display *display = data->display;
+#endif
         data->cursor_window = win;
         wine_tsx11_lock();
-        if (data->cursor) XDefineCursor( data->display, win, data->cursor );
+        if (data->cursor) XDefineCursor( display, win, data->cursor );
         wine_tsx11_unlock();
     }
 }
@@ -484,18 +493,23 @@
     else /* set the same cursor for all top-level windows of the current thread */
     {
         struct x11drv_thread_data *data = x11drv_thread_data();
+#ifdef HAVE_LIBXXF86DGA2
+        Display *display = DGAUsed ? gdi_display : data->display;
+#else
+        Display *display = data->display;
+#endif
 
         wine_tsx11_lock();
-        cursor = create_cursor( data->display, lpCursor );
+        cursor = create_cursor( display, lpCursor );
         if (cursor)
         {
-            if (data->cursor) XFreeCursor( data->display, data->cursor );
+            if (data->cursor) XFreeCursor( display, data->cursor );
             data->cursor = cursor;
             if (data->cursor_window)
             {
-                XDefineCursor( data->display, data->cursor_window, cursor );
+                XDefineCursor( display, data->cursor_window, cursor );
                 /* Make the change take effect immediately */
-                XFlush( data->display );
+                XFlush( display );
             }
         }
         wine_tsx11_unlock();
@@ -507,7 +521,11 @@
  */
 void X11DRV_SetCursorPos( INT x, INT y )
 {
+#ifdef HAVE_LIBXXF86DGA2
+    Display *display = DGAUsed ? gdi_display : thread_display();
+#else
     Display *display = thread_display();
+#endif
 
     TRACE( "warping to (%d,%d)\n", x, y );
 
@@ -522,7 +540,11 @@
  */
 void X11DRV_GetCursorPos(LPPOINT pos)
 {
+#ifdef HAVE_LIBXXF86DGA2
+  Display *display = DGAUsed ? gdi_display : thread_display();
+#else
   Display *display = thread_display();
+#endif
   Window root, child;
   int rootX, rootY, winX, winY;
   unsigned int xstate;
--- windows/input.c.unpatched	2004-07-31 01:07:26.000000000 +0100
+++ windows/input.c	2004-07-31 01:08:23.000000000 +0100
@@ -248,10 +248,10 @@
         SystemParametersInfoA(SPI_GETMOUSE, 0, accel, 0);
 
         accelMult = 1;
-        if (mi->dx > accel[0] && accel[2] != 0)
+        if (labs(mi->dx) > accel[0] && accel[2] != 0)
         {
             accelMult = 2;
-            if ((mi->dx > accel[1]) && (accel[2] == 2))
+            if ((labs(mi->dx) > accel[1]) && (accel[2] == 2))
             {
                 accelMult = 4;
             }
@@ -259,10 +259,10 @@
         posX += (long)mi->dx * accelMult;
 
         accelMult = 1;
-        if (mi->dy > accel[0] && accel[2] != 0)
+        if (labs(mi->dy) > accel[0] && accel[2] != 0)
         {
             accelMult = 2;
-            if ((mi->dy > accel[1]) && (accel[2] == 2))
+            if ((labs(mi->dy) > accel[1]) && (accel[2] == 2))
             {
                 accelMult = 4;
             }
@@ -490,7 +490,7 @@
     if (!pt) return 0;
     pt->x = PosX;
     pt->y = PosY;
-    if (USER_Driver.pGetCursorPos) USER_Driver.pGetCursorPos( pt );
+    //if (USER_Driver.pGetCursorPos) USER_Driver.pGetCursorPos( pt );
     return 1;
 }
 
