forked from Mirrors/wine-wine
user32: Retrieve the current cursor position from the server.
parent
a7da164949
commit
39c4e6d1d9
|
@ -197,8 +197,29 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
|
BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
|
||||||
{
|
{
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
if (!pt) return FALSE;
|
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;
|
SERVER_END_REQ;
|
||||||
if (ret) ret = USER_Driver->pSetCursorPos( x, y );
|
if (ret) USER_Driver->pSetCursorPos( x, y );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1272,8 +1272,6 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD event_flags, DWORD
|
||||||
req->msg = message;
|
req->msg = message;
|
||||||
req->wparam = wVk;
|
req->wparam = wVk;
|
||||||
req->lparam = lParam;
|
req->lparam = lParam;
|
||||||
req->x = cursor_pos.x;
|
|
||||||
req->y = cursor_pos.y;
|
|
||||||
req->time = time;
|
req->time = time;
|
||||||
req->info = dwExtraInfo;
|
req->info = dwExtraInfo;
|
||||||
wine_server_call( req );
|
wine_server_call( req );
|
||||||
|
|
|
@ -92,7 +92,7 @@ static const UINT button_up_flags[NB_BUTTONS] =
|
||||||
MOUSEEVENTF_XUP
|
MOUSEEVENTF_XUP
|
||||||
};
|
};
|
||||||
|
|
||||||
POINT cursor_pos;
|
static POINT cursor_pos;
|
||||||
static HWND cursor_window;
|
static HWND cursor_window;
|
||||||
static DWORD last_time_modified;
|
static DWORD last_time_modified;
|
||||||
static RECT cursor_clip; /* Cursor clipping rect */
|
static RECT cursor_clip; /* Cursor clipping rect */
|
||||||
|
@ -1042,6 +1042,7 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
|
||||||
Window root, child;
|
Window root, child;
|
||||||
int rootX, rootY, winX, winY;
|
int rootX, rootY, winX, winY;
|
||||||
unsigned int xstate;
|
unsigned int xstate;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
if ((GetTickCount() - last_time_modified > 100) &&
|
if ((GetTickCount() - last_time_modified > 100) &&
|
||||||
|
@ -1051,12 +1052,12 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
|
||||||
winX += virtual_screen_rect.left;
|
winX += virtual_screen_rect.left;
|
||||||
winY += virtual_screen_rect.top;
|
winY += virtual_screen_rect.top;
|
||||||
TRACE("pointer at (%d,%d)\n", winX, winY );
|
TRACE("pointer at (%d,%d)\n", winX, winY );
|
||||||
cursor_pos.x = winX;
|
pos->x = winX;
|
||||||
cursor_pos.y = winY;
|
pos->y = winY;
|
||||||
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
*pos = cursor_pos;
|
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
return TRUE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -609,8 +609,6 @@ extern int alloc_system_colors;
|
||||||
extern int xrender_error_base;
|
extern int xrender_error_base;
|
||||||
extern HMODULE x11drv_module;
|
extern HMODULE x11drv_module;
|
||||||
|
|
||||||
extern POINT cursor_pos;
|
|
||||||
|
|
||||||
/* atoms */
|
/* atoms */
|
||||||
|
|
||||||
enum x11drv_atoms
|
enum x11drv_atoms
|
||||||
|
|
Loading…
Reference in New Issue