Skip to content

Commit

Permalink
fix mouselock rebase, again
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Oct 1, 2024
1 parent 163ba36 commit 8ac0a07
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions mouselock.patch
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,35 @@ index c20ba170285..fb13399d22c 100644
2.46.2


From e41ef995e33e90e36b58755bc1d2d422bbcfc4c1 Mon Sep 17 00:00:00 2001
From 115603da061bbbaa73fa1b4540f9f146aff453f0 Mon Sep 17 00:00:00 2001
From: Giraffe1966 <[email protected]>
Date: Sun, 10 Dec 2023 10:27:18 +0000
Subject: [PATCH 2/4] Make relative motion smoother at lower mouse movement
speeds.

---
dlls/winewayland.drv/wayland_pointer.c | 13 ++++++++++---
dlls/winewayland.drv/wayland_pointer.c | 19 ++++++++++++++++---
dlls/winewayland.drv/waylanddrv.h | 2 ++
2 files changed, 12 insertions(+), 3 deletions(-)
2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c
index fb13399d22c..c6cd4446a95 100644
index fb13399d22c..f6788db6f75 100644
--- a/dlls/winewayland.drv/wayland_pointer.c
+++ b/dlls/winewayland.drv/wayland_pointer.c
@@ -261,17 +261,24 @@ static void relative_pointer_v1_relative_motion(void *private,
@@ -261,17 +261,30 @@ static void relative_pointer_v1_relative_motion(void *private,
HWND hwnd;
POINT screen;
struct wayland_win_data *data;
+ struct wayland_surface *surface;
+ struct wayland_pointer *pointer = &process_wayland.pointer;

if (!(hwnd = wayland_pointer_get_focused_hwnd())) return;
if (!(data = wayland_win_data_get(hwnd))) return;
+ if (!(surface = data->wayland_surface))
+ {
+ wayland_win_data_release(data);
+ return;
+ }

+ pthread_mutex_lock(&pointer->mutex);
wayland_surface_coords_to_window(data->wayland_surface,
Expand Down Expand Up @@ -106,7 +112,7 @@ index 3dee8e432df..cd89f4959b1 100644
2.46.2


From d3707854f663684d025422624461f045cc2526eb Mon Sep 17 00:00:00 2001
From df76baa7b2371b9fa668c299d701395ae8f12c8d Mon Sep 17 00:00:00 2001
From: Giraffe1966 <[email protected]>
Date: Mon, 11 Dec 2023 20:31:26 +0000
Subject: [PATCH 3/4] Prevent left click from disabling cursor lock.
Expand All @@ -132,7 +138,7 @@ index 14862e9a8a4..6f903a84acd 100644
2.46.2


From 46b1b0c2737e9f9784b2051a08d4b00fee73ed35 Mon Sep 17 00:00:00 2001
From b9abcc45748807c36d3c2b9a48e96e2047ebc1f7 Mon Sep 17 00:00:00 2001
From: Giraffe1966 <[email protected]>
Date: Sun, 17 Dec 2023 06:37:18 +0000
Subject: [PATCH 4/4] Ensure the pointer is warped to the confinement region
Expand All @@ -144,7 +150,7 @@ Subject: [PATCH 4/4] Ensure the pointer is warped to the confinement region
2 files changed, 102 insertions(+), 32 deletions(-)

diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c
index c6cd4446a95..b41752ac02b 100644
index f6788db6f75..fb851318432 100644
--- a/dlls/winewayland.drv/wayland_pointer.c
+++ b/dlls/winewayland.drv/wayland_pointer.c
@@ -92,11 +92,84 @@ static void pointer_handle_motion_internal(wl_fixed_t sx, wl_fixed_t sy)
Expand Down Expand Up @@ -241,7 +247,7 @@ index c6cd4446a95..b41752ac02b 100644
pthread_mutex_unlock(&pointer->mutex);

/* The cursor is undefined at every enter, so we set it again with
@@ -796,24 +871,18 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
@@ -802,24 +877,18 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
confine_rect->right - confine_rect->left,
confine_rect->bottom - confine_rect->top);

Expand Down Expand Up @@ -278,7 +284,7 @@ index c6cd4446a95..b41752ac02b 100644

TRACE("Confining to hwnd=%p wayland=%d,%d+%d,%d\n",
pointer->constraint_hwnd,
@@ -827,20 +896,19 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
@@ -833,20 +902,19 @@ static void wayland_pointer_update_constraint(struct wl_surface *wl_surface,
{
HWND hwnd = wl_surface_get_user_data(wl_surface);

Expand Down

0 comments on commit 8ac0a07

Please sign in to comment.