mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 04:34:48 +00:00
user32/tests: Fix some assumption about absolute window positions.
This commit is contained in:
parent
1bc6b9622f
commit
87653d26a2
|
@ -10203,14 +10203,16 @@ static void window_from_point_proc(HWND parent)
|
||||||
child_static = CreateWindowExA(0, "static", "static", WS_CHILD | WS_VISIBLE,
|
child_static = CreateWindowExA(0, "static", "static", WS_CHILD | WS_VISIBLE,
|
||||||
0, 0, 100, 100, parent, 0, NULL, NULL);
|
0, 0, 100, 100, parent, 0, NULL, NULL);
|
||||||
ok(child_static != 0, "CreateWindowEx failed\n");
|
ok(child_static != 0, "CreateWindowEx failed\n");
|
||||||
pt.x = pt.y = 150;
|
pt.x = pt.y = 50;
|
||||||
|
ClientToScreen( child_static, &pt );
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
ok(win == parent, "WindowFromPoint returned %p, expected %p\n", win, parent);
|
ok(win == parent, "WindowFromPoint returned %p, expected %p\n", win, parent);
|
||||||
|
|
||||||
child_button = CreateWindowExA(0, "button", "button", WS_CHILD | WS_VISIBLE,
|
child_button = CreateWindowExA(0, "button", "button", WS_CHILD | WS_VISIBLE,
|
||||||
100, 0, 100, 100, parent, 0, NULL, NULL);
|
100, 0, 100, 100, parent, 0, NULL, NULL);
|
||||||
ok(child_button != 0, "CreateWindowEx failed\n");
|
ok(child_button != 0, "CreateWindowEx failed\n");
|
||||||
pt.x = 250;
|
pt.x = pt.y = 50;
|
||||||
|
ClientToScreen( child_button, &pt );
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
ok(win == child_button, "WindowFromPoint returned %p, expected %p\n", win, child_button);
|
ok(win == child_button, "WindowFromPoint returned %p, expected %p\n", win, child_button);
|
||||||
|
|
||||||
|
@ -10243,7 +10245,7 @@ static void window_from_point_proc(HWND parent)
|
||||||
CloseHandle(end_event);
|
CloseHandle(end_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_window_from_point(const char *argv0)
|
static void test_window_from_point(HWND main_window, const char *argv0)
|
||||||
{
|
{
|
||||||
HWND hwnd, child, win;
|
HWND hwnd, child, win;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
@ -10253,12 +10255,15 @@ static void test_window_from_point(const char *argv0)
|
||||||
HANDLE start_event, end_event;
|
HANDLE start_event, end_event;
|
||||||
|
|
||||||
hwnd = CreateWindowExA(0, "MainWindowClass", NULL, WS_POPUP | WS_VISIBLE,
|
hwnd = CreateWindowExA(0, "MainWindowClass", NULL, WS_POPUP | WS_VISIBLE,
|
||||||
100, 100, 200, 100, 0, 0, NULL, NULL);
|
100, 100, 200, 100, main_window, 0, NULL, NULL);
|
||||||
ok(hwnd != 0, "CreateWindowEx failed\n");
|
ok(hwnd != 0, "CreateWindowEx failed\n");
|
||||||
|
|
||||||
pt.x = pt.y = 150;
|
pt.x = pt.y = 50;
|
||||||
|
ClientToScreen( hwnd, &pt );
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
pt.x = 250;
|
pt.x = 150;
|
||||||
|
pt.y = 50;
|
||||||
|
ClientToScreen( hwnd, &pt );
|
||||||
if(win == hwnd)
|
if(win == hwnd)
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
if(win != hwnd) {
|
if(win != hwnd) {
|
||||||
|
@ -10270,7 +10275,8 @@ static void test_window_from_point(const char *argv0)
|
||||||
child = CreateWindowExA(0, "static", "static", WS_CHILD | WS_VISIBLE,
|
child = CreateWindowExA(0, "static", "static", WS_CHILD | WS_VISIBLE,
|
||||||
0, 0, 100, 100, hwnd, 0, NULL, NULL);
|
0, 0, 100, 100, hwnd, 0, NULL, NULL);
|
||||||
ok(child != 0, "CreateWindowEx failed\n");
|
ok(child != 0, "CreateWindowEx failed\n");
|
||||||
pt.x = pt.y = 150;
|
pt.x = pt.y = 50;
|
||||||
|
ClientToScreen( hwnd, &pt );
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
ok(win == hwnd, "WindowFromPoint returned %p, expected %p\n", win, hwnd);
|
ok(win == hwnd, "WindowFromPoint returned %p, expected %p\n", win, hwnd);
|
||||||
DestroyWindow(child);
|
DestroyWindow(child);
|
||||||
|
@ -10298,11 +10304,13 @@ static void test_window_from_point(const char *argv0)
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
ok(win == child, "WindowFromPoint returned %p, expected %p\n", win, child);
|
ok(win == child, "WindowFromPoint returned %p, expected %p\n", win, child);
|
||||||
|
|
||||||
simulate_click(150, 150);
|
simulate_click(pt.x, pt.y);
|
||||||
flush_events(TRUE);
|
flush_events(TRUE);
|
||||||
|
|
||||||
child = GetWindow(child, GW_HWNDNEXT);
|
child = GetWindow(child, GW_HWNDNEXT);
|
||||||
pt.x = 250;
|
pt.x = 150;
|
||||||
|
pt.y = 50;
|
||||||
|
ClientToScreen( hwnd, &pt );
|
||||||
win = WindowFromPoint(pt);
|
win = WindowFromPoint(pt);
|
||||||
ok(win == child, "WindowFromPoint returned %p, expected %p\n", win, child);
|
ok(win == child, "WindowFromPoint returned %p, expected %p\n", win, child);
|
||||||
|
|
||||||
|
@ -13084,7 +13092,7 @@ START_TEST(win)
|
||||||
|
|
||||||
/* Add the tests below this line */
|
/* Add the tests below this line */
|
||||||
test_child_window_from_point();
|
test_child_window_from_point();
|
||||||
test_window_from_point(argv[0]);
|
test_window_from_point(hwndMain, argv[0]);
|
||||||
test_thick_child_size(hwndMain);
|
test_thick_child_size(hwndMain);
|
||||||
test_fullscreen();
|
test_fullscreen();
|
||||||
test_hwnd_message();
|
test_hwnd_message();
|
||||||
|
|
Loading…
Reference in a new issue