summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2020-05-20 23:45:43 -0400
committerFurkan Sahin <furkan-dev@proton.me>2020-05-20 23:45:43 -0400
commit97ab14fa3a81fef95e1c47859fc6a2aa986a0609 (patch)
tree8f5bf05b1e210485aba9c93b4b897dac3310f595
parent43ec3019c2902c1d2627f95002ddc036b727f384 (diff)
input/pointer: send pointer enter event on confine warp
The spec has this to say about sending events on confine creation: Whenever the confinement is activated, it is guaranteed that the surface the pointer is confined to will already have received pointer focus and that the pointer will be within the region passed to the request creating this object. ...and on region update: If warped, a wl_pointer.motion event will be emitted, but no wp_relative_pointer.relative_motion event. Prior to this patch, sway did neither, and updated the hardware cursor position without notifying the underlying surface until the next motion event. This led to inconsistent results, especially in applications that draw their own software cursor.
-rw-r--r--sway/input/cursor.c2
-rw-r--r--sway/input/seatop_default.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index b336fcbc..b9643535 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -807,6 +807,8 @@ static void check_constraint_region(struct sway_cursor *cursor) {
wlr_cursor_warp_closest(cursor->cursor, NULL,
sx + con->content_x - view->geometry.x,
sy + con->content_y - view->geometry.y);
+
+ cursor_rebase(cursor);
}
}
}
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index 32c7318b..048bad75 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -656,6 +656,7 @@ static void handle_rebase(struct sway_seat *seat, uint32_t time_msec) {
if (surface) {
if (seat_is_input_allowed(seat, surface)) {
wlr_seat_pointer_notify_enter(seat->wlr_seat, surface, sx, sy);
+ wlr_seat_pointer_notify_motion(seat->wlr_seat, time_msec, sx, sy);
}
} else {
cursor_update_image(cursor, e->previous_node);