mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-10 04:27:51 -05:00
seat/pointer: add wl_pointer.warp event support
Add support for the wl_pointer.warp event from Wayland protocol version 11. https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/340 This allows the compositor to notify clients when the pointer position has changed due to surface movement or compositor action, rather than input device motion. This is useful for tracking cursor position across surface boundaries and dynamic repositioning.
This commit is contained in:
parent
1f0fb95e3b
commit
f175c2f592
5 changed files with 54 additions and 2 deletions
|
|
@ -34,6 +34,7 @@ struct wlr_pointer {
|
|||
struct wl_signal button; // struct wlr_pointer_button_event
|
||||
struct wl_signal axis; // struct wlr_pointer_axis_event
|
||||
struct wl_signal frame;
|
||||
struct wl_signal warp; // struct wlr_pointer_warp_event
|
||||
|
||||
struct wl_signal swipe_begin; // struct wlr_pointer_swipe_begin_event
|
||||
struct wl_signal swipe_update; // struct wlr_pointer_swipe_update_event
|
||||
|
|
@ -82,7 +83,10 @@ struct wlr_pointer_axis_event {
|
|||
double delta;
|
||||
int32_t delta_discrete;
|
||||
};
|
||||
|
||||
struct wlr_pointer_warp_event {
|
||||
struct wlr_pointer *pointer;
|
||||
double sx, sy;
|
||||
};
|
||||
struct wlr_pointer_swipe_begin_event {
|
||||
struct wlr_pointer *pointer;
|
||||
uint32_t time_msec;
|
||||
|
|
|
|||
|
|
@ -432,6 +432,15 @@ void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time_msec,
|
|||
*/
|
||||
void wlr_seat_pointer_send_frame(struct wlr_seat *wlr_seat);
|
||||
|
||||
/**
|
||||
* Send a warp event to the surface with pointer focus. This notifies the client
|
||||
* that the pointer location has changed due to surface movement or compositor
|
||||
* action, rather than input device motion. Coordinates are surface-local.
|
||||
* This function does not respect pointer grabs.
|
||||
*/
|
||||
void wlr_seat_pointer_send_warp(struct wlr_seat *wlr_seat,
|
||||
double sx, double sy);
|
||||
|
||||
/**
|
||||
* Notify the seat of a pointer enter event to the given surface and request it
|
||||
* to be the focused surface for the pointer. Pass surface-local coordinates
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue