mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 11:21:28 +00:00
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.
This commit is contained in:
parent
704d675a36
commit
6ea45395c7
|
@ -807,6 +807,8 @@ static void check_constraint_region(struct sway_cursor *cursor) {
|
||||||
wlr_cursor_warp_closest(cursor->cursor, NULL,
|
wlr_cursor_warp_closest(cursor->cursor, NULL,
|
||||||
sx + con->content_x - view->geometry.x,
|
sx + con->content_x - view->geometry.x,
|
||||||
sy + con->content_y - view->geometry.y);
|
sy + con->content_y - view->geometry.y);
|
||||||
|
|
||||||
|
cursor_rebase(cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -656,6 +656,7 @@ static void handle_rebase(struct sway_seat *seat, uint32_t time_msec) {
|
||||||
if (surface) {
|
if (surface) {
|
||||||
if (seat_is_input_allowed(seat, surface)) {
|
if (seat_is_input_allowed(seat, surface)) {
|
||||||
wlr_seat_pointer_notify_enter(seat->wlr_seat, surface, sx, sy);
|
wlr_seat_pointer_notify_enter(seat->wlr_seat, surface, sx, sy);
|
||||||
|
wlr_seat_pointer_notify_motion(seat->wlr_seat, time_msec, sx, sy);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cursor_update_image(cursor, e->previous_node);
|
cursor_update_image(cursor, e->previous_node);
|
||||||
|
|
Loading…
Reference in a new issue