Make GetCursorPos call XQueryPointer.
This commit is contained in:
parent
6e33f63e4a
commit
624f14e776
|
@ -21,7 +21,6 @@ debug_channels (ttydrv)
|
|||
@ cdecl GetDIData(ptr long ptr ptr long) TTYDRV_GetDIData
|
||||
@ cdecl InitMouse(ptr) TTYDRV_InitMouse
|
||||
@ cdecl SetCursor(ptr) TTYDRV_SetCursor
|
||||
@ cdecl MoveCursor(long long) TTYDRV_MoveCursor
|
||||
@ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive
|
||||
@ cdecl SetScreenSaveActive(long) TTYDRV_SetScreenSaveActive
|
||||
@ cdecl GetScreenSaveTimeout() TTYDRV_GetScreenSaveTimeout
|
||||
|
|
|
@ -94,13 +94,6 @@ void TTYDRV_SetCursor( struct tagCURSORICONINFO *lpCursor )
|
|||
{
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_MoveCursor (TTYDRV.@)
|
||||
*/
|
||||
void TTYDRV_MoveCursor(WORD wAbsX, WORD wAbsY)
|
||||
{
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* TTYDRV_GetScreenSaveActive (TTYDRV.@)
|
||||
*
|
||||
|
|
|
@ -44,7 +44,7 @@ VOID WINAPI DISPLAY_SetCursor( struct tagCURSORICONINFO *lpCursor )
|
|||
*/
|
||||
VOID WINAPI DISPLAY_MoveCursor( WORD wAbsX, WORD wAbsY )
|
||||
{
|
||||
USER_Driver.pMoveCursor(wAbsX, wAbsY);
|
||||
USER_Driver.pSetCursorPos(wAbsX, wAbsY);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -70,7 +70,8 @@ static BOOL load_driver(void)
|
|||
GET_USER_FUNC(GetDIData);
|
||||
GET_USER_FUNC(InitMouse);
|
||||
GET_USER_FUNC(SetCursor);
|
||||
GET_USER_FUNC(MoveCursor);
|
||||
GET_USER_FUNC(GetCursorPos);
|
||||
GET_USER_FUNC(SetCursorPos);
|
||||
GET_USER_FUNC(GetScreenSaveActive);
|
||||
GET_USER_FUNC(SetScreenSaveActive);
|
||||
GET_USER_FUNC(GetScreenSaveTimeout);
|
||||
|
|
|
@ -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 InitMouse(ptr) X11DRV_InitMouse
|
||||
@ 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 SetScreenSaveActive(long) X11DRV_SetScreenSaveActive
|
||||
@ cdecl GetScreenSaveTimeout() X11DRV_GetScreenSaveTimeout
|
||||
|
|
|
@ -50,7 +50,8 @@ typedef struct tagUSER_DRIVER {
|
|||
/* mouse functions */
|
||||
void (*pInitMouse)(LPMOUSE_EVENT_PROC);
|
||||
void (*pSetCursor)(struct tagCURSORICONINFO *);
|
||||
void (*pMoveCursor)(WORD, WORD);
|
||||
void (*pGetCursorPos)(LPPOINT);
|
||||
void (*pSetCursorPos)(INT,INT);
|
||||
/* screen saver functions */
|
||||
BOOL (*pGetScreenSaveActive)(void);
|
||||
void (*pSetScreenSaveActive)(BOOL);
|
||||
|
|
|
@ -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)
|
||||
*/
|
||||
|
|
|
@ -368,9 +368,11 @@ BOOL WINAPI SwapMouseButton( BOOL fSwap )
|
|||
*/
|
||||
BOOL16 WINAPI GetCursorPos16( POINT16 *pt )
|
||||
{
|
||||
POINT pos;
|
||||
if (!pt) return 0;
|
||||
pt->x = PosX;
|
||||
pt->y = PosY;
|
||||
GetCursorPos(&pos);
|
||||
pt->x = pos.x;
|
||||
pt->y = pos.y;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -383,10 +385,32 @@ BOOL WINAPI GetCursorPos( POINT *pt )
|
|||
if (!pt) return 0;
|
||||
pt->x = PosX;
|
||||
pt->y = PosY;
|
||||
if (USER_Driver.pGetCursorPos) USER_Driver.pGetCursorPos( pt );
|
||||
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
|
||||
*
|
||||
|
|
|
@ -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,
|
||||
|
@ -218,7 +218,7 @@ void X11DRV_MoveCursor(WORD wAbsX, WORD wAbsY)
|
|||
* are supposed to move to; if so, we don't need to do anything.
|
||||
*/
|
||||
|
||||
Display *display = thread_display();
|
||||
Display *display = thread_display();
|
||||
Window root, child;
|
||||
int rootX, rootY, winX, winY;
|
||||
unsigned int xstate;
|
||||
|
@ -233,8 +233,30 @@ void X11DRV_MoveCursor(WORD wAbsX, WORD wAbsY)
|
|||
return;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in New Issue