aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar David Rosca <nowrep@gmail.com>2021-08-05 06:26:34 +0200
committerLibravatar Tudor Brindus <vulcainus@gmail.com>2021-08-05 09:26:11 -0400
commitd0fe721fbbfbbdced91b94889c863c68c33c8125 (patch)
tree9659dec4949f0e5d3a3be5d865adccde3b80cd8d
parentman: update Pango font description URL (diff)
downloadsway-d0fe721fbbfbbdced91b94889c863c68c33c8125.tar.gz
sway-d0fe721fbbfbbdced91b94889c863c68c33c8125.tar.zst
sway-d0fe721fbbfbbdced91b94889c863c68c33c8125.zip
seatop_down: Change type of sx, sy to double in begin_seatop_down
Losing the precision resulted in wlr_cursor and wlr_seat::pointer_state getting out of sync during pointer motion in seatop_down. Since the difference was always under 1 px, it was practically impossible to notice in normal use. But because of being out of sync, cursor_rebase would always end up incorrectly calling wlr_seat_pointer_notify_motion from seatop_default_begin (on releasing mouse button) which broke cursor locking. See #5405 Closes #4632
-rw-r--r--include/sway/input/seat.h2
-rw-r--r--sway/input/seatop_down.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 4118df66..a2b5d2a1 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -239,7 +239,7 @@ enum wlr_edges find_resize_edge(struct sway_container *cont,
239void seatop_begin_default(struct sway_seat *seat); 239void seatop_begin_default(struct sway_seat *seat);
240 240
241void seatop_begin_down(struct sway_seat *seat, struct sway_container *con, 241void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
242 uint32_t time_msec, int sx, int sy); 242 uint32_t time_msec, double sx, double sy);
243 243
244void seatop_begin_move_floating(struct sway_seat *seat, 244void seatop_begin_move_floating(struct sway_seat *seat,
245 struct sway_container *con); 245 struct sway_container *con);
diff --git a/sway/input/seatop_down.c b/sway/input/seatop_down.c
index 844cf5ab..7607a598 100644
--- a/sway/input/seatop_down.c
+++ b/sway/input/seatop_down.c
@@ -90,7 +90,7 @@ static const struct sway_seatop_impl seatop_impl = {
90}; 90};
91 91
92void seatop_begin_down(struct sway_seat *seat, struct sway_container *con, 92void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
93 uint32_t time_msec, int sx, int sy) { 93 uint32_t time_msec, double sx, double sy) {
94 seatop_end(seat); 94 seatop_end(seat);
95 95
96 struct seatop_down_event *e = 96 struct seatop_down_event *e =