From 94c5e361fbb229b0cd6853e2102a7d95f1f358b3 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 22:12:02 +0300 Subject: better public interface and doxygen --- tests/cocoa/test_cursor.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/cocoa/test_cursor.m') diff --git a/tests/cocoa/test_cursor.m b/tests/cocoa/test_cursor.m index 0f3ba06..7a328f2 100644 --- a/tests/cocoa/test_cursor.m +++ b/tests/cocoa/test_cursor.m @@ -22,8 +22,12 @@ int main(void) assert(surface); NSWindow *window = (NSWindow *)yasl_surface_get_native_handle(surface); NSView *view = window.contentView; + NSEvent *cursor = [NSEvent enterExitEventWithType:NSEventTypeCursorUpdate + location:NSMakePoint(100, 120) modifierFlags:0 timestamp:0 + windowNumber:window.windowNumber context:nil eventNumber:0 trackingNumber:0 userData:NULL]; + assert(cursor); yasl_surface_set_cursor(surface, YASL_CURSOR_HIDDEN); - [view cursorUpdate:nil]; + [view cursorUpdate:cursor]; NSCursor *hidden = [NSCursor currentCursor]; assert_transparent(hidden); @@ -31,7 +35,7 @@ int main(void) location:NSMakePoint(100, 120) modifierFlags:0 timestamp:0 windowNumber:window.windowNumber context:nil eventNumber:0 clickCount:0 pressure:0]; [view mouseMoved:motion]; - [view cursorUpdate:nil]; + [view cursorUpdate:cursor]; assert([NSCursor currentCursor] == hidden); struct yasl_input_event event; bool moved = false; @@ -41,10 +45,10 @@ int main(void) assert(moved); [[NSCursor arrowCursor] set]; /* Simulate leaving and re-entering. */ - [view cursorUpdate:nil]; + [view cursorUpdate:cursor]; assert([NSCursor currentCursor] == hidden); yasl_surface_set_cursor(surface, YASL_CURSOR_ARROW); - [view cursorUpdate:nil]; + [view cursorUpdate:cursor]; assert([NSCursor currentCursor] == [NSCursor arrowCursor]); yasl_surface_destroy(surface); yasl_display_close(display); -- cgit v1.2.3