user32: Retrieve the current cursor position from the server.

oldstable
Alexandre Julliard 2011-02-28 22:50:21 +01:00
parent a7da164949
commit 39c4e6d1d9
4 changed files with 29 additions and 11 deletions

View File

@ -197,8 +197,29 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
{
BOOL ret;
if (!pt) return FALSE;
return USER_Driver->pGetCursorPos( pt );
ret = USER_Driver->pGetCursorPos( pt );
SERVER_START_REQ( set_cursor )
{
if (ret) /* update it */
{
req->flags = SET_CURSOR_POS;
req->x = pt->x;
req->y = pt->y;
}
if ((ret = !wine_server_call( req )))
{
pt->x = reply->new_x;
pt->y = reply->new_y;
}
}
SERVER_END_REQ;
return ret;
}
@ -245,7 +266,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetCursorPos( INT x, INT y )
}
}
SERVER_END_REQ;
if (ret) ret = USER_Driver->pSetCursorPos( x, y );
if (ret) USER_Driver->pSetCursorPos( x, y );
return ret;
}

View File

@ -1272,8 +1272,6 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD event_flags, DWORD
req->msg = message;
req->wparam = wVk;
req->lparam = lParam;
req->x = cursor_pos.x;
req->y = cursor_pos.y;
req->time = time;
req->info = dwExtraInfo;
wine_server_call( req );

View File

@ -92,7 +92,7 @@ static const UINT button_up_flags[NB_BUTTONS] =
MOUSEEVENTF_XUP
};
POINT cursor_pos;
static POINT cursor_pos;
static HWND cursor_window;
static DWORD last_time_modified;
static RECT cursor_clip; /* Cursor clipping rect */
@ -1042,6 +1042,7 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
Window root, child;
int rootX, rootY, winX, winY;
unsigned int xstate;
BOOL ret = FALSE;
wine_tsx11_lock();
if ((GetTickCount() - last_time_modified > 100) &&
@ -1051,12 +1052,12 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
winX += virtual_screen_rect.left;
winY += virtual_screen_rect.top;
TRACE("pointer at (%d,%d)\n", winX, winY );
cursor_pos.x = winX;
cursor_pos.y = winY;
pos->x = winX;
pos->y = winY;
ret = TRUE;
}
*pos = cursor_pos;
wine_tsx11_unlock();
return TRUE;
return ret;
}

View File

@ -609,8 +609,6 @@ extern int alloc_system_colors;
extern int xrender_error_base;
extern HMODULE x11drv_module;
extern POINT cursor_pos;
/* atoms */
enum x11drv_atoms