What needs to be done to fix Wine DGA Input.
Serge Ryabchun
sr at energy.uch.net
Thu Jun 27 03:23:27 CDT 2002
On Thu, 27 Jun 2002, Adam Luchjenbroers wrote:
>
> > What needs to be fixed to make DGA input under Wine function correctly?
>
> I'll clarify what my question was here.
>
> I was having trouble with DGA, where I would start up a DGA application and
> it would not accept keyboard or mouse input.
>
> So I did a search of comp.emulators.ms-windows.wine which turned up a similar
> question with an answer to the effect that DGA input in Wine was presently
> broken.
>
> So I'd like to know how it was broken, where to look in the code, and what I
> can do to help fix it. I want working DGA input and I'm willing to do the
> coding to fix it. I was simply hoping someone could tell me where to look
> instead of needing me to hunt for the problem, as this would save me time.
>
look at attachment but it is not finished
--
Serge Ryabchun sr at energy.uch.net
-------------- next part --------------
--- winex-cvs/windows/x11drv/event.c Mon Apr 22 10:04:14 2002
+++ wine/windows/x11drv/event.c Wed May 15 16:41:29 2002
@@ -107,8 +107,10 @@
static int DGAKeyPressEventType;
static int DGAKeyReleaseEventType;
-static BOOL DGAUsed = FALSE;
-static HWND DGAhwnd = 0;
+BOOL DGAUsed = FALSE;
+HWND DGAhwnd = 0;
+//static BOOL DGAUsed = FALSE;
+//static HWND DGAhwnd = 0;
extern void X11DRV_DGAMotionEvent( HWND hwnd, XDGAMotionEvent *event );
extern void X11DRV_DGAButtonPressEvent( HWND hwnd, XDGAButtonEvent *event );
@@ -126,16 +128,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;
--- winex-cvs/dlls/x11drv/mouse.c Wed Jan 2 10:36:37 2002
+++ wine/dlls/x11drv/mouse.c Wed May 15 16:48:55 2002
@@ -21,6 +21,8 @@
int X11DRV_NoCursor;
+extern BOOL DGAUsed;
+
/**********************************************************************/
#define NB_BUTTONS 5 /* Windows can handle 3 buttons and the wheel too */
@@ -372,7 +374,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;
}
@@ -400,7 +402,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 );
@@ -419,7 +421,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 );
@@ -434,7 +436,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;
@@ -460,7 +462,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,
More information about the wine-devel
mailing list