wined3d: Only update the cursor position the first time we display it.

This commit is contained in:
Alexandre Julliard 2011-05-16 20:16:15 +02:00
parent 30e187e019
commit 38d0d9fe80
1 changed files with 11 additions and 8 deletions

View File

@ -5352,17 +5352,20 @@ void CDECL wined3d_device_set_cursor_position(struct wined3d_device *device,
BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show)
{
BOOL oldVisible = device->bCursorVisible;
POINT pt;
TRACE("device %p, show %#x.\n", device, show);
/* When ShowCursor is first called it should make the cursor appear at the
* OS's last known cursor position. Because of this, some applications
* just repetitively call ShowCursor in order to update the cursor's
* position. This behavior is undocumented. */
GetCursorPos(&pt);
device->xScreenSpace = pt.x;
device->yScreenSpace = pt.y;
/*
* When ShowCursor is first called it should make the cursor appear at the OS's last
* known cursor position.
*/
if (show && !oldVisible)
{
POINT pt;
GetCursorPos(&pt);
device->xScreenSpace = pt.x;
device->yScreenSpace = pt.y;
}
if (device->hardwareCursor)
{