diff options
Diffstat (limited to 'tests/cocoa/test_cursor.m')
| -rw-r--r-- | tests/cocoa/test_cursor.m | 12 |
1 files changed, 8 insertions, 4 deletions
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); |
