sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 63420a2caa728dd52121fc4b9a3d6d7a4f2c3444
parent 169b90f90b518b2ca2d4bc445d6bfb05b57a20df
Author: Kenny Levinsen <kl@kl.wtf>
Date:   Sun,  7 Feb 2021 14:17:56 +0100

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:
Mswaynag/swaynag.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git 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); }