[PATCH 2/2] comctl32/tests: Restore the cursor position after moving it.
Huw Davies
huw at codeweavers.com
Wed Aug 31 05:18:42 CDT 2016
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
dlls/comctl32/tests/listview.c | 3 +++
dlls/comctl32/tests/tooltips.c | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index ec87e3b..5e69414 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -5765,6 +5765,7 @@ static void test_oneclickactivate(void)
HWND hwnd, fg;
RECT rect;
INT r;
+ POINT orig_pos;
hwnd = CreateWindowExA(0, "SysListView32", "foo", WS_VISIBLE|WS_CHILD|LVS_LIST,
10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
@@ -5791,6 +5792,7 @@ static void test_oneclickactivate(void)
ok(r == 0, "should not fail\n");
GetWindowRect(hwnd, &rect);
+ GetCursorPos(&orig_pos);
SetCursorPos(rect.left+5, rect.top+5);
flush_events();
r = SendMessageA(hwnd, WM_MOUSEMOVE, MAKELONG(1, 1), 0);
@@ -5810,6 +5812,7 @@ static void test_oneclickactivate(void)
expect(1, r);
DestroyWindow(hwnd);
+ SetCursorPos(orig_pos.x, orig_pos.y);
}
static void test_callback_mask(void)
diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c
index 3d5ca9a..72bfc95 100644
--- a/dlls/comctl32/tests/tooltips.c
+++ b/dlls/comctl32/tests/tooltips.c
@@ -152,6 +152,7 @@ static void test_customdraw(void) {
DWORD iterationNumber;
WNDCLASSA wc;
LRESULT lResult;
+ POINT orig_pos;
/* Create a class to use the custom draw wndproc */
wc.style = CS_HREDRAW | CS_VREDRAW;
@@ -166,6 +167,8 @@ static void test_customdraw(void) {
wc.lpfnWndProc = custom_draw_wnd_proc;
RegisterClassA(&wc);
+ GetCursorPos(&orig_pos);
+
for (iterationNumber = 0;
iterationNumber < sizeof(expectedResults)/sizeof(expectedResults[0]);
iterationNumber++) {
@@ -238,7 +241,7 @@ static void test_customdraw(void) {
DestroyWindow(parent);
}
-
+ SetCursorPos(orig_pos.x, orig_pos.y);
}
static const CHAR testcallbackA[] = "callback";
--
2.8.2
More information about the wine-patches
mailing list