From 5ef6ca21ab9e1cf4f69254234d190a634b777d52 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 09:38:31 +0300 Subject: Remove deprecated Cocoa OpenGL and private compatibility APIs --- tests/common/test_events.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'tests/common/test_events.c') diff --git a/tests/common/test_events.c b/tests/common/test_events.c index fcfc118..e9f61da 100644 --- a/tests/common/test_events.c +++ b/tests/common/test_events.c @@ -179,20 +179,23 @@ static void test_failures(void) } -static void test_legacy_poll_does_not_spin(void) +static void test_fifo_preserves_notifications(void) { struct yasl_private_display d; struct yasl_surface a, b; setup(&d, &a, &b); yasl_private_surface_notify_state(&a, YASL_PRIVATE_STATE_ACTIVATED); yasl_private_surface_notify_close(&b); - assert(yasl_private_events_pending(&d)); + yasl_private_surface_notify_composition(&a, "preedit", 0, 7); + assert(input_queue_push(&b.input, &(struct yasl_private_event){ + .type = YASL_PRIVATE_EVENT_PEN, .surface = &b})); + const enum yasl_private_event_type types[] = {YASL_PRIVATE_EVENT_WINDOW_STATE, + YASL_PRIVATE_EVENT_WINDOW_CLOSE, YASL_PRIVATE_EVENT_COMPOSITION, YASL_PRIVATE_EVENT_PEN}; struct yasl_private_event ev; - assert(!yasl_private_surface_poll_event(&a, &ev)); - assert(!yasl_private_events_pending(&d)); - assert(input_queue_push(&b.input, &(struct yasl_private_event){.type = YASL_PRIVATE_EVENT_KEY, .surface = &b})); - assert(!yasl_private_surface_poll_event(&a, &ev)); - assert(yasl_private_surface_poll_event(&b, &ev) && ev.surface == &b); + for (size_t i = 0; i < sizeof(types) / sizeof(*types); ++i) { + assert(yasl_private_display_poll_event(&d, &ev)); + assert(ev.type == types[i] && ev.surface == (i % 2 ? &b : &a)); + } assert(!yasl_private_events_pending(&d)); teardown(&d, &a, &b); } @@ -203,6 +206,6 @@ int main(void) test_post_cleanup(); test_damage(); test_failures(); - test_legacy_poll_does_not_spin(); + test_fifo_preserves_notifications(); return 0; } -- cgit v1.2.3