diff options
Diffstat (limited to 'tests/common/test_backends.c')
| -rw-r--r-- | tests/common/test_backends.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/common/test_backends.c b/tests/common/test_backends.c index 4f49765..605dac0 100644 --- a/tests/common/test_backends.c +++ b/tests/common/test_backends.c @@ -160,6 +160,23 @@ static void x11_behavior(struct yasl_loop *loop, struct yasl_display *d, struct assert(w->configures > 0); struct yasl_vector2i size = yasl_surface_geometry(w->surface).size; assert(size.x == 200 && size.y == 120); + /* A server-generated motion verifies the XI2 subscription and cookie + * dispatch path, including source-device lookup, rather than SendEvent. */ + struct yasl_input_event pointer_event; + while (yasl_surface_input_poll(w->surface, &pointer_event)) {} + XWarpPointer(native, None, window, 0, 0, 0, 0, 80, 50); + XFlush(native); + pump(loop, d, NULL); + bool saw_motion = false; + while (yasl_surface_input_poll(w->surface, &pointer_event)) { + if (pointer_event.kind == YASL_INPUT_MOUSE && pointer_event.mouse.kind == YASL_PTR_MOTION) { + assert(pointer_event.mouse.device == YASL_PTR_DEV_MOUSE); + assert(!pointer_event.mouse.pen.pressure); + if (pointer_event.mouse.pos.x == 80 && pointer_event.mouse.pos.y == 50) + saw_motion = true; + } + } + assert(saw_motion); XEvent key = {0}; key.xkey = (XKeyEvent){.type = KeyPress, .display = native, .window = window, .root = DefaultRootWindow(native), .same_screen = True, |
