Rebase against bc282905d9491b9f9fe4ae4b69a8ccdf99c5aaa8.

This commit is contained in:
Zebediah Figura
2020-06-23 18:07:36 -05:00
parent 8402c95961
commit 7766c17912
36 changed files with 524 additions and 1918 deletions

View File

@@ -1,262 +0,0 @@
From fe1ae8a2e1ee05143a9a0b7248420edada9bc09d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 14 Nov 2019 16:41:43 +0100
Subject: [PATCH 01/12] user32/tests: Add rawinput test for ClipCursor
interactions.
This shows unexpected rawinput messages triggered from cursor clipping.
The sleeps are required to let native cursor clipping time to activate.
We also repeat the clipping multiple times to be increase the chances
that the counts will be wrong as it doesn't always trigger.
---
dlls/user32/tests/input.c | 226 ++++++++++++++++++++++++++++++++++++++
1 file changed, 226 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 478c269017a..bf9d19906a8 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1826,6 +1826,231 @@ static void test_RegisterRawInputDevices(void)
DestroyWindow(hwnd);
}
+static int rawinput_received;
+static int rawinput_received_foreground;
+static int rawinput_motion_x;
+static int rawinput_motion_y;
+static HANDLE rawinput_wndproc_done;
+
+static LRESULT CALLBACK rawinput_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+ UINT ret, raw_size;
+ RAWINPUT raw;
+
+ if (msg == WM_INPUT)
+ {
+ rawinput_received++;
+
+ ok(wparam == RIM_INPUT || wparam == RIM_INPUTSINK, "Unexpected wparam: %lu\n", wparam);
+ if (wparam == RIM_INPUT)
+ rawinput_received_foreground++;
+
+ ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &raw_size, sizeof(RAWINPUTHEADER));
+ ok(ret == 0, "GetRawInputData failed\n");
+ ok(raw_size <= sizeof(raw), "Unexpected rawinput data size: %u", raw_size);
+
+ if (raw_size <= sizeof(raw))
+ {
+ ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &raw, &raw_size, sizeof(RAWINPUTHEADER));
+ ok(ret > 0 && ret != (UINT)-1, "GetRawInputData failed\n");
+ ok(raw.header.dwType == RIM_TYPEMOUSE, "Unexpected rawinput type: %u\n", raw.header.dwType);
+
+ if (raw.header.dwType == RIM_TYPEMOUSE)
+ {
+ ok(!(raw.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE), "Unexpected absolute rawinput motion\n");
+ ok(!(raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP), "Unexpected virtual desktop rawinput motion\n");
+ rawinput_motion_x += raw.data.mouse.lLastX;
+ rawinput_motion_y += raw.data.mouse.lLastY;
+ }
+ }
+ }
+
+ if (msg == WM_USER)
+ SetEvent(rawinput_wndproc_done);
+
+ return DefWindowProcA(hwnd, msg, wparam, lparam);
+}
+
+struct rawinput_mouse_thread_params
+{
+ int step;
+ HWND window;
+ HANDLE ready;
+ HANDLE start;
+};
+
+static DWORD WINAPI rawinput_mouse_thread(void *arg)
+{
+ struct rawinput_mouse_thread_params *params = arg;
+ RECT rect_105 = { 105, 105, 105, 105 };
+ RECT rect_110 = { 110, 110, 110, 110 };
+ int i;
+
+ while (WaitForSingleObject(params->ready, INFINITE) == 0)
+ {
+ ResetEvent(params->ready);
+ SetEvent(params->start);
+
+ switch (params->step)
+ {
+ case 0:
+ case 1:
+ case 2:
+ mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0);
+ mouse_event(MOUSEEVENTF_MOVE, 0, -1, 0, 0);
+ break;
+ case 3:
+ for (i = 0; i < 10; ++i)
+ {
+ ClipCursor(&rect_105);
+ Sleep(5);
+ ClipCursor(&rect_110);
+ Sleep(5);
+ ClipCursor(NULL);
+ Sleep(5);
+ }
+ break;
+ case 4:
+ for (i = 0; i < 10; ++i)
+ {
+ ClipCursor(&rect_110);
+ Sleep(5);
+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
+ ClipCursor(NULL);
+ Sleep(5);
+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
+ ClipCursor(&rect_110);
+ ClipCursor(NULL);
+ Sleep(5);
+ }
+ break;
+ default:
+ return 0;
+ }
+
+ PostMessageA(params->window, WM_USER, 0, 0);
+ }
+
+ return 0;
+}
+
+struct rawinput_mouse_test
+{
+ BOOL register_device;
+ BOOL register_window;
+ DWORD register_flags;
+ int expect_received;
+ int expect_received_foreground;
+ int expect_motion_x;
+ int expect_motion_y;
+ BOOL todo;
+};
+
+static void test_rawinput_mouse(void)
+{
+ struct rawinput_mouse_thread_params params;
+ RAWINPUTDEVICE raw_devices[1];
+ HANDLE thread;
+ DWORD ret;
+ int i;
+
+ struct rawinput_mouse_test tests[] =
+ {
+ { FALSE, FALSE, 0, 0, 0, 0, 0, FALSE },
+ { TRUE, FALSE, 0, 2, 2, -1, -1, FALSE },
+ { TRUE, TRUE, 0, 2, 2, -1, -1, FALSE },
+ { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE },
+ { TRUE, TRUE, 0, 20, 20, 20, 20, TRUE },
+ };
+
+ mouse_event(MOUSEEVENTF_ABSOLUTE, 100, 100, 0, 0);
+ SetCursorPos(100, 100);
+
+ rawinput_wndproc_done = CreateEventA(NULL, FALSE, FALSE, NULL);
+ ok(rawinput_wndproc_done != NULL, "CreateEvent failed\n");
+
+ params.window = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, 0, NULL, NULL, NULL);
+ ok(params.window != 0, "CreateWindow failed\n");
+
+ ShowWindow(params.window, SW_SHOW);
+ SetWindowPos(params.window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
+ SetForegroundWindow(params.window);
+ UpdateWindow(params.window);
+ empty_message_queue();
+
+ SetWindowLongPtrA(params.window, GWLP_WNDPROC, (LONG_PTR)rawinput_wndproc);
+
+ params.step = 0;
+ params.ready = CreateEventA(NULL, FALSE, FALSE, NULL);
+ ok(params.ready != NULL, "CreateEvent failed\n");
+
+ params.start = CreateEventA(NULL, FALSE, FALSE, NULL);
+ ok(params.start != NULL, "CreateEvent failed\n");
+
+ thread = CreateThread(NULL, 0, rawinput_mouse_thread, &params, 0, NULL);
+ ok(thread != NULL, "CreateThread failed\n");
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ rawinput_received = 0;
+ rawinput_received_foreground = 0;
+ rawinput_motion_x = 0;
+ rawinput_motion_y = 0;
+
+ raw_devices[0].usUsagePage = 0x01;
+ raw_devices[0].usUsage = 0x02;
+ raw_devices[0].dwFlags = tests[i].register_flags;
+ raw_devices[0].hwndTarget = tests[i].register_window ? params.window : 0;
+
+ if (tests[i].register_device)
+ {
+ SetLastError(0xdeadbeef);
+ ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE));
+ ok(ret, "%d: RegisterRawInputDevices failed\n", i);
+ ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError());
+ }
+
+ params.step = i;
+ SetEvent(params.ready);
+
+ WaitForSingleObject(params.start, INFINITE);
+ ResetEvent(params.start);
+
+ while (MsgWaitForMultipleObjects(1, &rawinput_wndproc_done, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0)
+ empty_message_queue();
+ ResetEvent(rawinput_wndproc_done);
+
+ /* Wine is sometimes passing some of the conditions, but not always, let's test
+ * all at once in the todo block, there should be at least one that fails. */
+ todo_wine_if(tests[i].todo)
+ ok(rawinput_received == tests[i].expect_received &&
+ rawinput_received_foreground == tests[i].expect_received_foreground &&
+ rawinput_motion_x == tests[i].expect_motion_x &&
+ rawinput_motion_y == tests[i].expect_motion_y,
+ "%d: Unexpected rawinput results: received %d, %d in foreground, motion is %dx%d\n",
+ i, rawinput_received, rawinput_received_foreground, rawinput_motion_x, rawinput_motion_y);
+
+ if (tests[i].register_device)
+ {
+ raw_devices[0].dwFlags = RIDEV_REMOVE;
+ raw_devices[0].hwndTarget = 0;
+
+ SetLastError(0xdeadbeef);
+ ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE));
+ ok(ret, "%d: RegisterRawInputDevices failed\n", i);
+ ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError());
+ }
+ }
+
+ params.step = -1;
+ SetEvent(params.ready);
+ WaitForSingleObject(thread, INFINITE);
+
+ CloseHandle(params.start);
+ CloseHandle(params.ready);
+ CloseHandle(thread);
+}
+
static void test_key_map(void)
{
HKL kl = GetKeyboardLayout(0);
@@ -3326,6 +3551,7 @@ START_TEST(input)
test_GetRawInputData();
test_GetKeyboardLayoutList();
test_RegisterRawInputDevices();
+ test_rawinput_mouse();
if(pGetMouseMovePointsEx)
test_GetMouseMovePointsEx();
--
2.24.1

View File

@@ -1,70 +0,0 @@
From d407a40a11f0cbf3e61faded5e6e7e1e2e63ef9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 14 Nov 2019 17:03:38 +0100
Subject: [PATCH 02/12] user32/tests: Add rawinput test for cross-thread
interactions.
The rawinput messages are received on the target window if is from the
same process as the foreground window, it doesn't need to be the
foreground window itself.
---
dlls/user32/tests/input.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index bf9d19906a8..bdcc6834d9d 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1884,6 +1884,7 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg)
struct rawinput_mouse_thread_params *params = arg;
RECT rect_105 = { 105, 105, 105, 105 };
RECT rect_110 = { 110, 110, 110, 110 };
+ HWND window;
int i;
while (WaitForSingleObject(params->ready, INFINITE) == 0)
@@ -1924,6 +1925,26 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg)
Sleep(5);
}
break;
+ case 5:
+ case 6:
+ window = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, 0, NULL, NULL, NULL);
+ ok(window != 0, "%d: CreateWindow failed\n", params->step);
+
+ ShowWindow(window, SW_SHOW);
+ SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
+ SetForegroundWindow(window);
+ UpdateWindow(window);
+ empty_message_queue();
+
+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0);
+ mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0);
+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0);
+
+ empty_message_queue();
+
+ DestroyWindow(window);
+ break;
default:
return 0;
}
@@ -1959,8 +1980,14 @@ static void test_rawinput_mouse(void)
{ FALSE, FALSE, 0, 0, 0, 0, 0, FALSE },
{ TRUE, FALSE, 0, 2, 2, -1, -1, FALSE },
{ TRUE, TRUE, 0, 2, 2, -1, -1, FALSE },
+
+ /* clip cursor tests */
{ TRUE, TRUE, 0, 0, 0, 0, 0, TRUE },
{ TRUE, TRUE, 0, 20, 20, 20, 20, TRUE },
+
+ /* same-process foreground tests */
+ { TRUE, TRUE, 0, 2, 2, 0, 0, TRUE },
+ { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE },
};
mouse_event(MOUSEEVENTF_ABSOLUTE, 100, 100, 0, 0);
--
2.24.1

View File

@@ -1,173 +0,0 @@
From 66869bba59b74f8bb77b4c1b7c44ef3c6ca7e4ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 14 Nov 2019 18:44:28 +0100
Subject: [PATCH] user32/tests: Add rawinput test for cross-process
interactions.
Validating the rest of the assumption, rawinput messages are not
received anymore if the foreground window is from another process.
---
dlls/user32/tests/input.c | 86 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 84 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 1738706c8a5..79d6a046a8b 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -46,6 +46,7 @@
*/
#include <stdarg.h>
+#include <stdio.h>
#include <assert.h>
#include "windef.h"
@@ -1874,8 +1875,36 @@ struct rawinput_mouse_thread_params
HWND window;
HANDLE ready;
HANDLE start;
+ const char *argv0;
};
+static void rawinput_mouse_process(void)
+{
+ HWND window;
+ HANDLE start_event, stop_event;
+
+ start_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "test_rawinput_mouse_start");
+ ok(start_event != 0, "OpenEventA failed, error: %u\n", GetLastError());
+
+ stop_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "test_rawinput_mouse_stop");
+ ok(stop_event != 0, "OpenEventA failed, error: %u\n", GetLastError());
+
+ window = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 200, 100, 100, 100, 0, NULL, NULL, NULL);
+ ok(window != 0, "CreateWindow failed\n");
+
+ ShowWindow(window, SW_SHOW);
+ SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
+ SetForegroundWindow(window);
+ UpdateWindow(window);
+ empty_message_queue();
+
+ SetEvent(start_event);
+ while (MsgWaitForMultipleObjects(1, &stop_event, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0)
+ empty_message_queue();
+
+ DestroyWindow(window);
+}
+
static DWORD WINAPI rawinput_mouse_thread(void *arg)
{
struct rawinput_mouse_thread_params *params = arg;
@@ -1883,6 +1912,11 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg)
RECT rect_110 = { 110, 110, 110, 110 };
HWND window;
int i;
+ char path[MAX_PATH];
+ PROCESS_INFORMATION process_info;
+ STARTUPINFOA startup_info;
+ HANDLE start_event, stop_event;
+ BOOL ret;
while (WaitForSingleObject(params->ready, INFINITE) == 0)
{
@@ -1942,6 +1976,39 @@ static DWORD WINAPI rawinput_mouse_thread(void *arg)
DestroyWindow(window);
break;
+ case 7:
+ case 8:
+ start_event = CreateEventA(NULL, 0, 0, "test_rawinput_mouse_start");
+ ok(start_event != 0, "%d: CreateEventA failed, error %u\n", params->step, GetLastError());
+
+ stop_event = CreateEventA(NULL, 0, 0, "test_rawinput_mouse_stop");
+ ok(stop_event != 0, "%d: CreateEventA failed, error %u\n", params->step, GetLastError());
+
+ memset(&startup_info, 0, sizeof(startup_info));
+ startup_info.cb = sizeof(startup_info);
+ startup_info.dwFlags = STARTF_USESHOWWINDOW;
+ startup_info.wShowWindow = SW_SHOWNORMAL;
+
+ sprintf(path, "%s input test_rawinput_mouse", params->argv0);
+ ret = CreateProcessA(NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &startup_info, &process_info );
+ ok(ret, "%d: CreateProcess '%s' failed err %u.\n", params->step, path, GetLastError());
+
+ ret = WaitForSingleObject(start_event, 5000);
+ ok(ret == WAIT_OBJECT_0, "%d: WaitForSingleObject failed\n", params->step);
+
+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0);
+ mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0);
+ SendMessageA(GetForegroundWindow(), WM_USER, 0, 0);
+
+ SetEvent(stop_event);
+
+ winetest_wait_child_process(process_info.hProcess);
+ CloseHandle(process_info.hProcess);
+ CloseHandle(process_info.hThread);
+ CloseHandle(start_event);
+ CloseHandle(stop_event);
+ break;
default:
return 0;
}
@@ -1964,7 +2031,7 @@ struct rawinput_mouse_test
BOOL todo;
};
-static void test_rawinput_mouse(void)
+static void test_rawinput_mouse(const char *argv0)
{
struct rawinput_mouse_thread_params params;
RAWINPUTDEVICE raw_devices[1];
@@ -1985,11 +2052,17 @@ static void test_rawinput_mouse(void)
/* same-process foreground tests */
{ TRUE, TRUE, 0, 2, 2, 0, 0, TRUE },
{ TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE },
+
+ /* cross-process foreground tests */
+ { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE },
+ { TRUE, TRUE, RIDEV_INPUTSINK, 2, 0, 0, 0, TRUE },
};
mouse_event(MOUSEEVENTF_ABSOLUTE, 100, 100, 0, 0);
SetCursorPos(100, 100);
+ params.argv0 = argv0;
+
rawinput_wndproc_done = CreateEventA(NULL, FALSE, FALSE, NULL);
ok(rawinput_wndproc_done != NULL, "CreateEvent failed\n");
@@ -3552,11 +3625,20 @@ static void test_GetKeyboardLayoutList(void)
START_TEST(input)
{
+ char **argv;
+ int argc;
POINT pos;
init_function_pointers();
GetCursorPos( &pos );
+ argc = winetest_get_mainargs(&argv);
+ if (argc >= 3 && strcmp(argv[2], "test_rawinput_mouse") == 0)
+ {
+ rawinput_mouse_process();
+ return;
+ }
+
test_Input_blackbox();
test_Input_whitebox();
test_Input_unicode();
@@ -3575,7 +3657,7 @@ START_TEST(input)
test_GetRawInputData();
test_GetKeyboardLayoutList();
test_RegisterRawInputDevices();
- test_rawinput_mouse();
+ test_rawinput_mouse(argv[0]);
if(pGetMouseMovePointsEx)
test_GetMouseMovePointsEx();
--
2.25.1

View File

@@ -1,4 +1,4 @@
From 323c45f237fc828f32e27448e4c24649b69b49e0 Mon Sep 17 00:00:00 2001
From 38723990a094b598e988408149d1e04dac9b571e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 12 Nov 2019 12:41:55 +0100
Subject: [PATCH] server: Broadcast rawinput message if request flag is
@@ -8,23 +8,9 @@ If the request flag is equal to SEND_HWMSG_RAWINPUT, we broadcast the
message to all listening processes -or at least to the foreground
process until RIDEV_INPUTSINK is supported.
---
dlls/user32/tests/input.c | 2 +-
server/queue.c | 101 ++++++++++++++++++++++++++++++--------
2 files changed, 81 insertions(+), 22 deletions(-)
server/queue.c | 101 +++++++++++++++++++++++++++++++++++++++----------
1 file changed, 80 insertions(+), 21 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index d45a6b17ece..87e298ce8ff 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -2050,7 +2050,7 @@ static void test_rawinput_mouse(const char *argv0)
{ TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE },
/* cross-process foreground tests */
- { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE },
+ { TRUE, TRUE, 0, 0, 0, 0, 0, FALSE },
{ TRUE, TRUE, RIDEV_INPUTSINK, 2, 0, 0, 0, TRUE },
};
diff --git a/server/queue.c b/server/queue.c
index 05d7af0206f..e1a01389fcf 100644
--- a/server/queue.c
@@ -181,5 +167,5 @@ index 05d7af0206f..e1a01389fcf 100644
if (!(req_flags & SEND_HWMSG_WINDOW))
--
2.26.0
2.27.0

View File

@@ -1,43 +1,21 @@
From e8b90f221774d70fb9510b6de18378ab3abdcad2 Mon Sep 17 00:00:00 2001
From d337c8de3de6a0b7ff16cada895d2490d3240b53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 11 Sep 2019 10:15:20 +0200
Subject: [PATCH 09/12] winex11.drv: Listen to RawMotion and RawButton* events
in the desktop thread.
Subject: [PATCH] winex11.drv: Listen to RawMotion and RawButton* events in the
desktop thread.
We still need to send "normal" input from the clipping window thread
to trigger low-level hooks callbacks when clipping cursor. This is for
instance used in our dinput implementation.
---
dlls/user32/tests/input.c | 8 ++--
dlls/winex11.drv/event.c | 10 +++-
dlls/winex11.drv/mouse.c | 88 ++++++++++++++++++++++++++++------
dlls/winex11.drv/x11drv.h | 3 ++
dlls/winex11.drv/x11drv_main.c | 4 ++
5 files changed, 93 insertions(+), 20 deletions(-)
4 files changed, 89 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index d18ccfebcaf..a1f983f1960 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -2049,12 +2049,12 @@ static void test_rawinput_mouse(const char *argv0)
{ TRUE, TRUE, 0, 2, 2, -1, -1, FALSE },
/* clip cursor tests */
- { TRUE, TRUE, 0, 0, 0, 0, 0, TRUE },
- { TRUE, TRUE, 0, 20, 20, 20, 20, TRUE },
+ { TRUE, TRUE, 0, 0, 0, 0, 0, FALSE },
+ { TRUE, TRUE, 0, 20, 20, 20, 20, FALSE },
/* same-process foreground tests */
- { TRUE, TRUE, 0, 2, 2, 0, 0, TRUE },
- { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, TRUE },
+ { TRUE, TRUE, 0, 2, 2, 0, 0, FALSE },
+ { TRUE, TRUE, RIDEV_INPUTSINK, 2, 2, 0, 0, FALSE },
/* cross-process foreground tests */
{ TRUE, TRUE, 0, 0, 0, 0, 0, FALSE },
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 87ba808956f..b3faf3f7cc5 100644
index 07f7a1ad502..d722ba9d7cc 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -321,6 +321,10 @@ static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawE
@@ -76,10 +54,10 @@ index 87ba808956f..b3faf3f7cc5 100644
#endif
}
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 19ed2a29287..d331ed5aef8 100644
index 26e8b4eea92..ded877a140f 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -364,9 +364,9 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
@@ -362,9 +362,9 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
/***********************************************************************
@@ -91,7 +69,7 @@ index 19ed2a29287..d331ed5aef8 100644
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct x11drv_thread_data *data = x11drv_thread_data();
@@ -398,9 +398,21 @@ static void enable_xinput2(void)
@@ -396,9 +396,21 @@ static void enable_xinput2(void)
mask.mask_len = sizeof(mask_bits);
mask.deviceid = XIAllMasterDevices;
memset( mask_bits, 0, sizeof(mask_bits) );
@@ -114,7 +92,7 @@ index 19ed2a29287..d331ed5aef8 100644
pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 );
@@ -413,9 +425,9 @@ static void enable_xinput2(void)
@@ -411,9 +423,9 @@ static void enable_xinput2(void)
}
/***********************************************************************
@@ -126,7 +104,7 @@ index 19ed2a29287..d331ed5aef8 100644
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct x11drv_thread_data *data = x11drv_thread_data();
@@ -475,7 +487,7 @@ static BOOL grab_clipping_window( const RECT *clip )
@@ -473,7 +485,7 @@ static BOOL grab_clipping_window( const RECT *clip )
}
/* enable XInput2 unless we are already clipping */
@@ -135,7 +113,7 @@ index 19ed2a29287..d331ed5aef8 100644
if (data->xi2_state != xi_enabled)
{
@@ -505,7 +517,7 @@ static BOOL grab_clipping_window( const RECT *clip )
@@ -503,7 +515,7 @@ static BOOL grab_clipping_window( const RECT *clip )
if (!clipping_cursor)
{
@@ -144,7 +122,7 @@ index 19ed2a29287..d331ed5aef8 100644
DestroyWindow( msg_hwnd );
return FALSE;
}
@@ -586,7 +598,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd )
@@ -584,7 +596,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd )
TRACE( "clip hwnd reset from %p\n", hwnd );
data->clip_hwnd = 0;
data->clip_reset = GetTickCount();
@@ -153,7 +131,7 @@ index 19ed2a29287..d331ed5aef8 100644
DestroyWindow( hwnd );
}
else if (hwnd == GetForegroundWindow()) /* request to clip */
@@ -725,7 +737,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -723,7 +735,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
}
input->u.mi.dx += clip_rect.left;
input->u.mi.dy += clip_rect.top;
@@ -162,7 +140,7 @@ index 19ed2a29287..d331ed5aef8 100644
return;
}
@@ -765,7 +777,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -763,7 +775,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
SERVER_END_REQ;
}
@@ -171,7 +149,7 @@ index 19ed2a29287..d331ed5aef8 100644
}
#ifdef SONAME_LIBXCURSOR
@@ -1711,7 +1723,7 @@ void move_resize_window( HWND hwnd, int dir )
@@ -1709,7 +1721,7 @@ void move_resize_window( HWND hwnd, int dir )
input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.u.mi.time = GetTickCount();
input.u.mi.dwExtraInfo = 0;
@@ -180,7 +158,7 @@ index 19ed2a29287..d331ed5aef8 100644
}
while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
@@ -1894,6 +1906,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1892,6 +1904,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
x_rel = &thread_data->x_rel_valuator;
y_rel = &thread_data->y_rel_valuator;
@@ -188,7 +166,7 @@ index 19ed2a29287..d331ed5aef8 100644
input.u.mi.mouseData = 0;
input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
@@ -1929,10 +1942,53 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1927,10 +1940,53 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
return FALSE;
}
@@ -245,7 +223,7 @@ index 19ed2a29287..d331ed5aef8 100644
return TRUE;
}
@@ -2008,6 +2064,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
@@ -2006,6 +2062,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
case XI_RawMotion:
ret = X11DRV_RawMotion( event );
break;
@@ -257,7 +235,7 @@ index 19ed2a29287..d331ed5aef8 100644
default:
TRACE( "Unhandled event %#x\n", event->evtype );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 7145fec74e7..4a7cab67ada 100644
index 73b1e90f12e..6febdc18b0a 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -196,6 +196,8 @@ extern BOOL CDECL X11DRV_UnrealizePalette( HPALETTE hpal ) DECLSPEC_HIDDEN;
@@ -269,7 +247,7 @@ index 7145fec74e7..4a7cab67ada 100644
extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image,
const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits,
@@ -343,6 +345,7 @@ struct x11drv_thread_data
@@ -342,6 +344,7 @@ struct x11drv_thread_data
struct x11drv_valuator_data x_rel_valuator;
struct x11drv_valuator_data y_rel_valuator;
int xi2_core_pointer; /* XInput2 core pointer id */
@@ -278,10 +256,10 @@ index 7145fec74e7..4a7cab67ada 100644
extern struct x11drv_thread_data *x11drv_init_thread_data(void) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index ff9185a523c..f33a79d98bf 100644
index 20e829ba64f..4eaedd1c556 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -640,6 +640,8 @@ void CDECL X11DRV_ThreadDetach(void)
@@ -632,6 +632,8 @@ void CDECL X11DRV_ThreadDetach(void)
if (data)
{
@@ -290,7 +268,7 @@ index ff9185a523c..f33a79d98bf 100644
if (data->xim) XCloseIM( data->xim );
if (data->font_set) XFreeFontSet( data->display, data->font_set );
XCloseDisplay( data->display );
@@ -712,6 +714,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
@@ -701,6 +703,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
TlsSetValue( thread_data_tls_index, data );
if (use_xim) X11DRV_SetupXIM();
@@ -300,5 +278,5 @@ index ff9185a523c..f33a79d98bf 100644
return data;
}
--
2.24.1
2.27.0