From c059e3aa7f93da470f052a5cd8ee0d8dc969e679 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 13:44:13 +0300 Subject: rename and simplification --- tests/cocoa/test_native.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/cocoa/test_native.c') diff --git a/tests/cocoa/test_native.c b/tests/cocoa/test_native.c index 0c101dd..674513d 100644 --- a/tests/cocoa/test_native.c +++ b/tests/cocoa/test_native.c @@ -48,11 +48,14 @@ static void test_window(enum yasl_backend request, bool null_spec) struct state state = {.display = yasl_display_open(NULL, null_spec ? NULL : &spec)}; assert(state.display); assert(yasl_display_backend(state.display) == YASL_BACKEND_COCOA); - struct yasl_surface_spec surface = {.title = "Native backend test", .size = {160, 100}}; + struct yasl_window_cbs callbacks = {.draw = draw}; + struct yasl_window_spec surface = { + .title = "Native backend test", .size = {160, 100}, + .cbs = &callbacks, .ud = &state, + }; state.surface = yasl_surface_create_toplevel(state.display, &surface); assert(state.surface); - struct yasl_surface_cbs callbacks = {.draw = draw}; - yasl_surface_set_callbacks(state.surface, &callbacks, &state); + assert(!state.draws); callbacks.draw = NULL; yasl_surface_schedule_redraw(state.surface); uint64_t deadline = yasl_loop_now_ns() + 3000000000ull; -- cgit v1.2.3