--- wine-cvs/windows/x11drv/event.c Thu Jul 4 12:39:23 2002 +++ wine/windows/x11drv/event.c Sat Jul 20 10:01:59 2002 @@ -107,8 +107,8 @@ static int DGAKeyPressEventType; static int DGAKeyReleaseEventType; -static BOOL DGAUsed = FALSE; -static HWND DGAhwnd = 0; +BOOL DGAUsed = FALSE; +HWND DGAhwnd = 0; extern void X11DRV_DGAMotionEvent( HWND hwnd, XDGAMotionEvent *event ); extern void X11DRV_DGAButtonPressEvent( HWND hwnd, XDGAButtonEvent *event ); @@ -126,16 +126,21 @@ static int process_events( struct x11drv_thread_data *data ) { XEvent event; - int count = 0; + int count = 0, events; + + Display *display = DGAUsed ? gdi_display : data->display; wine_tsx11_lock(); - while ( XPending( data->display ) ) + while ( (events = XPending( display )) ) { - XNextEvent( data->display, &event ); - wine_tsx11_unlock(); - EVENT_ProcessEvent( &event ); - count++; - wine_tsx11_lock(); + do { + XNextEvent( display, &event ); + wine_tsx11_unlock(); + EVENT_ProcessEvent( &event ); + count++; + wine_tsx11_lock(); + } + while ( --events != 0); } wine_tsx11_unlock(); return count; --- wine-cvs/dlls/x11drv/mouse.c Wed Jun 19 09:59:39 2002 +++ wine/dlls/x11drv/mouse.c Sat Jul 20 10:01:24 2002 @@ -23,6 +23,8 @@ int X11DRV_NoCursor; +extern BOOL DGAUsed; + /**********************************************************************/ #define NB_BUTTONS 7 /* Windows can handle 3 buttons and the wheel too */ @@ -398,7 +400,7 @@ static BOOL CALLBACK set_win_cursor( HWND hwnd, LPARAM cursor ) { Window win = X11DRV_get_whole_window( hwnd ); - if (win) TSXDefineCursor( thread_display(), win, (Cursor)cursor ); + if (win) TSXDefineCursor( DGAUsed ? gdi_display : thread_display(), win, (Cursor)cursor ); return TRUE; } @@ -426,7 +428,7 @@ } else /* set the same cursor for all top-level windows of the current thread */ { - Display *display = thread_display(); + Display *display = DGAUsed ? gdi_display : thread_display(); wine_tsx11_lock(); cursor = X11DRV_GetCursor( display, lpCursor ); @@ -446,7 +448,7 @@ */ void X11DRV_SetCursorPos( INT x, INT y ) { - Display *display = thread_display(); + Display *display = DGAUsed ? gdi_display : thread_display(); TRACE( "warping to (%d,%d)\n", x, y ); @@ -461,7 +463,7 @@ */ void X11DRV_GetCursorPos(LPPOINT pos) { - Display *display = thread_display(); + Display *display = DGAUsed ? gdi_display : thread_display(); Window root, child; int rootX, rootY, winX, winY; unsigned int xstate; @@ -487,7 +489,7 @@ pKeyStateTable = key_state_table; /* Get the current mouse position and simulate an absolute mouse movement to initialize the mouse global variables */ - TSXQueryPointer( thread_display(), root_window, &root, &child, + TSXQueryPointer( DGAUsed ? gdi_display : thread_display(), root_window, &root, &child, &root_x, &root_y, &child_x, &child_y, &KeyState); update_key_state( KeyState ); send_mouse_event( 0, MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE,