Alexandre Julliard : wined3d: Switch to the software cursor when the position diverges from the hardware one .
Alexandre Julliard
julliard at winehq.org
Tue May 17 12:52:56 CDT 2011
Module: wine
Branch: master
Commit: 3d229b814e614d4ed529732fc511149d6ebc87a0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3d229b814e614d4ed529732fc511149d6ebc87a0
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon May 16 20:22:25 2011 +0200
wined3d: Switch to the software cursor when the position diverges from the hardware one.
---
dlls/wined3d/device.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 88aac03..7570bca 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5323,11 +5323,11 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device
wined3d_surface_unmap(cursor_image);
/* Create our cursor and clean up. */
cursor = CreateIconIndirect(&cursorInfo);
- SetCursor(cursor);
if (cursorInfo.hbmMask) DeleteObject(cursorInfo.hbmMask);
if (cursorInfo.hbmColor) DeleteObject(cursorInfo.hbmColor);
if (device->hardwareCursor) DestroyCursor(device->hardwareCursor);
device->hardwareCursor = cursor;
+ if (device->bCursorVisible) SetCursor( cursor );
HeapFree(GetProcessHeap(), 0, maskBits);
}
}
@@ -5345,6 +5345,19 @@ void CDECL wined3d_device_set_cursor_position(struct wined3d_device *device,
device->xScreenSpace = x_screen_space;
device->yScreenSpace = y_screen_space;
+
+ /* switch to the software cursor if position diverges from the hardware one */
+ if (device->hardwareCursor)
+ {
+ POINT pt;
+ GetCursorPos( &pt );
+ if (x_screen_space != pt.x || y_screen_space != pt.y)
+ {
+ if (device->bCursorVisible) SetCursor( NULL );
+ DestroyCursor( device->hardwareCursor );
+ device->hardwareCursor = 0;
+ }
+ }
}
BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show)
More information about the wine-cvs
mailing list