Module: wine
Branch: master
Commit: 38d0d9fe809ad368475876834af316d8692f7fa2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=38d0d9fe809ad368475876834…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Mon May 16 20:16:15 2011 +0200
wined3d: Only update the cursor position the first time we display it.
---
dlls/wined3d/device.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a4e85be..fb13e02 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)
{