diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 15:14:41 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 15:14:41 +0300 |
| commit | 4145406fae437dce2f0af6e078e35566634f2c19 (patch) | |
| tree | 689e3ab0e0033fc47be0b2d590b864692c936dcc /src/cocoa | |
| parent | 5d1eaf3beffd3653fc4c26b0557c77026bbd6bfc (diff) | |
perf: unify platform-independent state, branchless queue masking and native handle caching
Diffstat (limited to 'src/cocoa')
| -rw-r--r-- | src/cocoa/window.m | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cocoa/window.m b/src/cocoa/window.m index 8856fde..335c065 100644 --- a/src/cocoa/window.m +++ b/src/cocoa/window.m @@ -1259,6 +1259,7 @@ struct cocoa_display *cocoa_display_open(struct yasl_loop *loop, const struct ya const char *name = spec && spec->app_id ? spec->app_id : "YASL"; @autoreleasepool { app_init(name); } darwin_ctx.base.ops = &yasl_cocoa_backend; + darwin_ctx.base.native_handle = (__bridge void *)[NSApplication sharedApplication]; darwin_ctx.open = true; if (!loop) { darwin_ctx.loop = yasl_loop_create(); @@ -1341,6 +1342,9 @@ struct cocoa_surface *cocoa_surface_create_toplevel(struct cocoa_display *d, backing:NSBackingStoreBuffered defer:NO]; w->window.releasedWhenClosed = NO; + w->base.native_handle = (__bridge void *)w->window; + w->base.size = w->size; + w->base.scale_120 = w->scale_120; w->controller = [[YaslWindowController alloc] initWithWindow:w->window]; w->controller.surface = w; w->window.delegate = w->controller; @@ -1714,6 +1718,9 @@ struct cocoa_surface *cocoa_surface_create_popup(struct cocoa_surface *parent, backing:NSBackingStoreBuffered defer:NO]; w->window.releasedWhenClosed = NO; + w->base.native_handle = (__bridge void *)w->window; + w->base.size = w->size; + w->base.scale_120 = w->scale_120; w->window.opaque = NO; w->window.backgroundColor = [NSColor clearColor]; w->window.hasShadow = NO; |
