summaryrefslogtreecommitdiff
path: root/src/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/cocoa')
-rw-r--r--src/cocoa/window.m7
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;