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>
dev
Alexandros Frantzis 4 years ago
parent 28d66344a0
commit 4ea9be5193
  1. 3
      tests/weston-test-client-helper.c
  2. 1
      tests/weston-test-client-helper.h

@ -130,6 +130,7 @@ pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
else else
pointer->focus = NULL; pointer->focus = NULL;
pointer->serial = serial;
pointer->x = wl_fixed_to_int(x); pointer->x = wl_fixed_to_int(x);
pointer->y = wl_fixed_to_int(y); 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; struct pointer *pointer = data;
pointer->serial = serial;
pointer->focus = NULL; pointer->focus = NULL;
testlog("test-client: got pointer leave, surface %p\n", 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; struct pointer *pointer = data;
pointer->serial = serial;
pointer->button = button; pointer->button = button;
pointer->state = state; pointer->state = state;
pointer->button_time_msec = time_msec; pointer->button_time_msec = time_msec;

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

Loading…
Cancel
Save