aboutsummaryrefslogtreecommitdiff
path: root/swaynag/swaynag.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2021-02-07 14:17:56 +0100
committerFurkan Sahin <furkan-dev@proton.me>2021-02-07 14:17:56 +0100
commita2e97aa3c222bc7fc27ca1f492f65904fe33df6b (patch)
treee3f265fcd1fb3e768e1af3a69f5ba932ed5cf901 /swaynag/swaynag.c
parentbe73cd907e0af06bf2f7d3ffca411182331eae21 (diff)
swaynag: Use position from wl_pointer.enter
Only wl_pointer.motion was used to update pointer position, which would cause issues if the pointer was not moved prior to wl_pointer.button. This also fixes touch input through wl_pointer emulation, which fires wl_pointer.button immediately after wl_pointer.enter. Closes: https://github.com/swaywm/sway/issues/5991
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r--swaynag/swaynag.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index 46b90e03..1d1dbee2 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -178,6 +178,8 @@ static void wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
wl_fixed_t surface_x, wl_fixed_t surface_y) {
struct swaynag_seat *seat = data;
struct swaynag_pointer *pointer = &seat->pointer;
+ pointer->x = wl_fixed_to_int(surface_x);
+ pointer->y = wl_fixed_to_int(surface_y);
pointer->serial = serial;
update_cursor(seat);
}