From 38d0d9fe809ad368475876834af316d8692f7fa2 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 16 May 2011 20:16:15 +0200 Subject: [PATCH] wined3d: Only update the cursor position the first time we display it. --- dlls/wined3d/device.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a4e85befb97..fb13e024967 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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) {