@@ -46,22 +46,22 @@ index c20ba170285..fb13399d22c 100644
46
46
2.46.2
47
47
48
48
49
- From 32b0fccb746a675206639b6c990fed9a28829d10 Mon Sep 17 00:00:00 2001
49
+ From e41ef995e33e90e36b58755bc1d2d422bbcfc4c1 Mon Sep 17 00:00:00 2001
50
50
From: Giraffe1966 <35208168+Giraffe1966@users.noreply.github.com>
51
51
Date: Sun, 10 Dec 2023 10:27:18 +0000
52
52
Subject: [PATCH 2/4] Make relative motion smoother at lower mouse movement
53
53
speeds.
54
54
55
55
---
56
- dlls/winewayland.drv/wayland_pointer.c | 6 +++---
57
- dlls/winewayland.drv/waylanddrv.h | 2 ++
58
- 2 files changed, 5 insertions(+), 3 deletions(-)
56
+ dlls/winewayland.drv/wayland_pointer.c | 13 +++++++ +++---
57
+ dlls/winewayland.drv/waylanddrv.h | 2 ++
58
+ 2 files changed, 12 insertions(+), 3 deletions(-)
59
59
60
60
diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c
61
- index fb13399d22c..aa67a7ba722 100644
61
+ index fb13399d22c..c6cd4446a95 100644
62
62
--- a/dlls/winewayland.drv/wayland_pointer.c
63
63
+++ b/dlls/winewayland.drv/wayland_pointer.c
64
- @@ -261,18 +261,18 @@ static void relative_pointer_v1_relative_motion(void *private,
64
+ @@ -261,17 +261,24 @@ static void relative_pointer_v1_relative_motion(void *private,
65
65
HWND hwnd;
66
66
POINT screen;
67
67
struct wayland_win_data *data;
@@ -70,19 +70,25 @@ index fb13399d22c..aa67a7ba722 100644
70
70
if (!(hwnd = wayland_pointer_get_focused_hwnd())) return;
71
71
if (!(data = wayland_win_data_get(hwnd))) return;
72
72
73
+ + pthread_mutex_lock(&pointer->mutex);
73
74
wayland_surface_coords_to_window(data->wayland_surface,
74
75
- wl_fixed_to_double(dx),
75
76
- wl_fixed_to_double(dy),
76
77
+ wl_fixed_to_double(dx)+pointer->pendingX,
77
78
+ wl_fixed_to_double(dy)+pointer->pendingY,
78
79
(int *)&screen.x, (int *)&screen.y);
79
80
80
- wayland_win_data_release(data);
81
+ - wayland_win_data_release(data);
82
+ + double actualDx = (double)screen.x / (double)(surface->window.scale);
83
+ + pointer->pendingX = wl_fixed_to_double(dx)+pointer->pendingX-actualDx;
84
+ + double actualDy = (double)screen.y / (double)(surface->window.scale);
85
+ + pointer->pendingY = wl_fixed_to_double(dy)+pointer->pendingY-actualDy;
86
+
87
+ + pthread_mutex_unlock(&pointer->mutex);
88
+ + wayland_win_data_release(data);
81
89
82
- -
83
90
input.type = INPUT_MOUSE;
84
91
input.mi.dx = screen.x;
85
- input.mi.dy = screen.y;
86
92
diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h
87
93
index 3dee8e432df..cd89f4959b1 100644
88
94
--- a/dlls/winewayland.drv/waylanddrv.h
@@ -100,7 +106,7 @@ index 3dee8e432df..cd89f4959b1 100644
100
106
2.46.2
101
107
102
108
103
- From 3074e20ea7df45f4a588697aa1728d3ac3c65e37 Mon Sep 17 00:00:00 2001
109
+ From d3707854f663684d025422624461f045cc2526eb Mon Sep 17 00:00:00 2001
104
110
From: Giraffe1966 <35208168+Giraffe1966@users.noreply.github.com>
105
111
Date: Mon, 11 Dec 2023 20:31:26 +0000
106
112
Subject: [PATCH 3/4] Prevent left click from disabling cursor lock.
@@ -126,7 +132,7 @@ index 14862e9a8a4..6f903a84acd 100644
126
132
2.46.2
127
133
128
134
129
- From 8a5ef9a58f5c6a1c82746b6e78169c330b5a2937 Mon Sep 17 00:00:00 2001
135
+ From 46b1b0c2737e9f9784b2051a08d4b00fee73ed35 Mon Sep 17 00:00:00 2001
130
136
From: Giraffe1966 <35208168+Giraffe1966@users.noreply.github.com>
131
137
Date: Sun, 17 Dec 2023 06:37:18 +0000
132
138
Subject: [PATCH 4/4] Ensure the pointer is warped to the confinement region
@@ -138,7 +144,7 @@ Subject: [PATCH 4/4] Ensure the pointer is warped to the confinement region
138
144
2 files changed, 102 insertions(+), 32 deletions(-)
139
145
140
146
diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c
141
- index aa67a7ba722..26308df2a78 100644
147
+ index c6cd4446a95..b41752ac02b 100644
142
148
--- a/dlls/winewayland.drv/wayland_pointer.c
143
149
+++ b/dlls/winewayland.drv/wayland_pointer.c
144
150
@@ -92,11 +92,84 @@ static void pointer_handle_motion_internal(wl_fixed_t sx, wl_fixed_t sy)
@@ -235,7 +241,7 @@ index aa67a7ba722..26308df2a78 100644
235
241
pthread_mutex_unlock(&pointer->mutex);
236
242
237
243
/* The cursor is undefined at every enter, so we set it again with
238
- @@ -789 ,24 +864 ,18 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
244
+ @@ -796 ,24 +871 ,18 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
239
245
confine_rect->right - confine_rect->left,
240
246
confine_rect->bottom - confine_rect->top);
241
247
@@ -272,7 +278,7 @@ index aa67a7ba722..26308df2a78 100644
272
278
273
279
TRACE("Confining to hwnd=%p wayland=%d,%d+%d,%d\n",
274
280
pointer->constraint_hwnd,
275
- @@ -820 ,20 +889 ,19 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
281
+ @@ -827 ,20 +896 ,19 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
276
282
{
277
283
HWND hwnd = wl_surface_get_user_data(wl_surface);
278
284
0 commit comments