aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2021-02-07 14:17:56 +0100
committerLibravatar Tudor Brindus <me@tbrindus.ca>2021-02-07 20:18:53 -0500
commit63420a2caa728dd52121fc4b9a3d6d7a4f2c3444 (patch)
treee3f265fcd1fb3e768e1af3a69f5ba932ed5cf901 /swaynag
parentMake command line option lists const (diff)
downloadsway-63420a2caa728dd52121fc4b9a3d6d7a4f2c3444.tar.gz
sway-63420a2caa728dd52121fc4b9a3d6d7a4f2c3444.tar.zst
sway-63420a2caa728dd52121fc4b9a3d6d7a4f2c3444.zip
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')
-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,
178 wl_fixed_t surface_x, wl_fixed_t surface_y) { 178 wl_fixed_t surface_x, wl_fixed_t surface_y) {
179 struct swaynag_seat *seat = data; 179 struct swaynag_seat *seat = data;
180 struct swaynag_pointer *pointer = &seat->pointer; 180 struct swaynag_pointer *pointer = &seat->pointer;
181 pointer->x = wl_fixed_to_int(surface_x);
182 pointer->y = wl_fixed_to_int(surface_y);
181 pointer->serial = serial; 183 pointer->serial = serial;
182 update_cursor(seat); 184 update_cursor(seat);
183} 185}