tests: Store the pointer event serial

Store the pointer serial for events that provide one, so that it can be
used by tests to send requests that require it (e.g., setting the cursor
surface).

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This commit is contained in:
Alexandros Frantzis 2021-06-09 10:58:13 +03:00
parent 28d66344a0
commit 4ea9be5193
2 changed files with 4 additions and 0 deletions

View file

@ -130,6 +130,7 @@ pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
else
pointer->focus = NULL;
pointer->serial = serial;
pointer->x = wl_fixed_to_int(x);
pointer->y = wl_fixed_to_int(y);
@ -143,6 +144,7 @@ pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
{
struct pointer *pointer = data;
pointer->serial = serial;
pointer->focus = NULL;
testlog("test-client: got pointer leave, surface %p\n",
@ -172,6 +174,7 @@ pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
{
struct pointer *pointer = data;
pointer->serial = serial;
pointer->button = button;
pointer->state = state;
pointer->button_time_msec = time_msec;

View file

@ -99,6 +99,7 @@ struct input {
struct pointer {
struct wl_pointer *wl_pointer;
struct surface *focus;
uint32_t serial;
int x;
int y;
uint32_t button;