Make GetCursorPos call XQueryPointer.

This commit is contained in:
Ove Kaaven 2001-06-21 00:44:09 +00:00 committed by Alexandre Julliard
parent 6e33f63e4a
commit 624f14e776
9 changed files with 60 additions and 38 deletions

View File

@ -21,7 +21,6 @@ debug_channels (ttydrv)
@ cdecl GetDIData(ptr long ptr ptr long) TTYDRV_GetDIData @ cdecl GetDIData(ptr long ptr ptr long) TTYDRV_GetDIData
@ cdecl InitMouse(ptr) TTYDRV_InitMouse @ cdecl InitMouse(ptr) TTYDRV_InitMouse
@ cdecl SetCursor(ptr) TTYDRV_SetCursor @ cdecl SetCursor(ptr) TTYDRV_SetCursor
@ cdecl MoveCursor(long long) TTYDRV_MoveCursor
@ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive @ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive
@ cdecl SetScreenSaveActive(long) TTYDRV_SetScreenSaveActive @ cdecl SetScreenSaveActive(long) TTYDRV_SetScreenSaveActive
@ cdecl GetScreenSaveTimeout() TTYDRV_GetScreenSaveTimeout @ cdecl GetScreenSaveTimeout() TTYDRV_GetScreenSaveTimeout

View File

@ -94,13 +94,6 @@ void TTYDRV_SetCursor( struct tagCURSORICONINFO *lpCursor )
{ {
} }
/***********************************************************************
* TTYDRV_MoveCursor (TTYDRV.@)
*/
void TTYDRV_MoveCursor(WORD wAbsX, WORD wAbsY)
{
}
/*********************************************************************** /***********************************************************************
* TTYDRV_GetScreenSaveActive (TTYDRV.@) * TTYDRV_GetScreenSaveActive (TTYDRV.@)
* *

View File

@ -44,7 +44,7 @@ VOID WINAPI DISPLAY_SetCursor( struct tagCURSORICONINFO *lpCursor )
*/ */
VOID WINAPI DISPLAY_MoveCursor( WORD wAbsX, WORD wAbsY ) VOID WINAPI DISPLAY_MoveCursor( WORD wAbsX, WORD wAbsY )
{ {
USER_Driver.pMoveCursor(wAbsX, wAbsY); USER_Driver.pSetCursorPos(wAbsX, wAbsY);
} }
/*********************************************************************** /***********************************************************************

View File

@ -70,7 +70,8 @@ static BOOL load_driver(void)
GET_USER_FUNC(GetDIData); GET_USER_FUNC(GetDIData);
GET_USER_FUNC(InitMouse); GET_USER_FUNC(InitMouse);
GET_USER_FUNC(SetCursor); GET_USER_FUNC(SetCursor);
GET_USER_FUNC(MoveCursor); GET_USER_FUNC(GetCursorPos);
GET_USER_FUNC(SetCursorPos);
GET_USER_FUNC(GetScreenSaveActive); GET_USER_FUNC(GetScreenSaveActive);
GET_USER_FUNC(SetScreenSaveActive); GET_USER_FUNC(SetScreenSaveActive);
GET_USER_FUNC(GetScreenSaveTimeout); GET_USER_FUNC(GetScreenSaveTimeout);

View File

@ -21,7 +21,8 @@ debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
@ cdecl GetDIData(ptr long ptr ptr long) X11DRV_GetDIData @ cdecl GetDIData(ptr long ptr ptr long) X11DRV_GetDIData
@ cdecl InitMouse(ptr) X11DRV_InitMouse @ cdecl InitMouse(ptr) X11DRV_InitMouse
@ cdecl SetCursor(ptr) X11DRV_SetCursor @ cdecl SetCursor(ptr) X11DRV_SetCursor
@ cdecl MoveCursor(long long) X11DRV_MoveCursor @ cdecl GetCursorPos(ptr) X11DRV_GetCursorPos
@ cdecl SetCursorPos(long long) X11DRV_SetCursorPos
@ cdecl GetScreenSaveActive() X11DRV_GetScreenSaveActive @ cdecl GetScreenSaveActive() X11DRV_GetScreenSaveActive
@ cdecl SetScreenSaveActive(long) X11DRV_SetScreenSaveActive @ cdecl SetScreenSaveActive(long) X11DRV_SetScreenSaveActive
@ cdecl GetScreenSaveTimeout() X11DRV_GetScreenSaveTimeout @ cdecl GetScreenSaveTimeout() X11DRV_GetScreenSaveTimeout

View File

@ -50,7 +50,8 @@ typedef struct tagUSER_DRIVER {
/* mouse functions */ /* mouse functions */
void (*pInitMouse)(LPMOUSE_EVENT_PROC); void (*pInitMouse)(LPMOUSE_EVENT_PROC);
void (*pSetCursor)(struct tagCURSORICONINFO *); void (*pSetCursor)(struct tagCURSORICONINFO *);
void (*pMoveCursor)(WORD, WORD); void (*pGetCursorPos)(LPPOINT);
void (*pSetCursorPos)(INT,INT);
/* screen saver functions */ /* screen saver functions */
BOOL (*pGetScreenSaveActive)(void); BOOL (*pGetScreenSaveActive)(void);
void (*pSetScreenSaveActive)(BOOL); void (*pSetScreenSaveActive)(BOOL);

View File

@ -1467,25 +1467,6 @@ HCURSOR WINAPI SetCursor(
} }
/***********************************************************************
* SetCursorPos (USER.70)
*/
void WINAPI SetCursorPos16( INT16 x, INT16 y )
{
SetCursorPos( x, y );
}
/***********************************************************************
* SetCursorPos (USER32.@)
*/
BOOL WINAPI SetCursorPos( INT x, INT y )
{
USER_Driver.pMoveCursor( x, y );
return TRUE;
}
/*********************************************************************** /***********************************************************************
* ShowCursor (USER.71) * ShowCursor (USER.71)
*/ */

View File

@ -368,9 +368,11 @@ BOOL WINAPI SwapMouseButton( BOOL fSwap )
*/ */
BOOL16 WINAPI GetCursorPos16( POINT16 *pt ) BOOL16 WINAPI GetCursorPos16( POINT16 *pt )
{ {
POINT pos;
if (!pt) return 0; if (!pt) return 0;
pt->x = PosX; GetCursorPos(&pos);
pt->y = PosY; pt->x = pos.x;
pt->y = pos.y;
return 1; return 1;
} }
@ -383,10 +385,32 @@ BOOL WINAPI GetCursorPos( POINT *pt )
if (!pt) return 0; if (!pt) return 0;
pt->x = PosX; pt->x = PosX;
pt->y = PosY; pt->y = PosY;
if (USER_Driver.pGetCursorPos) USER_Driver.pGetCursorPos( pt );
return 1; return 1;
} }
/***********************************************************************
* SetCursorPos (USER.70)
*/
void WINAPI SetCursorPos16( INT16 x, INT16 y )
{
SetCursorPos( x, y );
}
/***********************************************************************
* SetCursorPos (USER32.@)
*/
BOOL WINAPI SetCursorPos( INT x, INT y )
{
if (USER_Driver.pSetCursorPos) USER_Driver.pSetCursorPos( x, y );
PosX = x;
PosY = y;
return TRUE;
}
/********************************************************************** /**********************************************************************
* EVENT_Capture * EVENT_Capture
* *

View File

@ -196,9 +196,9 @@ void X11DRV_SetCursor( CURSORICONINFO *lpCursor )
} }
/*********************************************************************** /***********************************************************************
* MoveCursor (X11DRV.@) * SetCursorPos (X11DRV.@)
*/ */
void X11DRV_MoveCursor(WORD wAbsX, WORD wAbsY) void X11DRV_SetCursorPos(INT wAbsX, INT wAbsY)
{ {
/* /*
* We do not want to create MotionNotify events here, * We do not want to create MotionNotify events here,
@ -234,7 +234,29 @@ void X11DRV_MoveCursor(WORD wAbsX, WORD wAbsY)
TRACE("(%d,%d): moving from (%d,%d)\n", wAbsX, wAbsY, winX, winY ); TRACE("(%d,%d): moving from (%d,%d)\n", wAbsX, wAbsY, winX, winY );
TSXWarpPointer( display, root_window, root_window, 0, 0, 0, 0, wAbsX, wAbsY ); wine_tsx11_lock();
XWarpPointer( display, root_window, root_window, 0, 0, 0, 0, wAbsX, wAbsY );
XFlush( display ); /* just in case */
wine_tsx11_unlock();
}
/***********************************************************************
* GetCursorPos (X11DRV.@)
*/
void X11DRV_GetCursorPos(LPPOINT pos)
{
Display *display = thread_display();
Window root, child;
int rootX, rootY, winX, winY;
unsigned int xstate;
if (!TSXQueryPointer( display, root_window, &root, &child,
&rootX, &rootY, &winX, &winY, &xstate ))
return;
TRACE("pointer at (%d,%d)\n", winX, winY );
pos->x = winX;
pos->y = winY;
} }
/*********************************************************************** /***********************************************************************