summaryrefslogtreecommitdiff
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m30
1 files changed, 18 insertions, 12 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 6139837..8735a6d 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -59,7 +59,6 @@
}
[self setAcceptsMouseMovedEvents:YES];
- [self setLevel: CGShieldingWindowLevel() + 1];
return (PuglWindow*)self;
}
@@ -445,17 +444,24 @@ puglCreateWindow(PuglView* view, const char* title)
[NSAutoreleasePool new];
impl->app = [NSApplication sharedApplication];
- NSString* titleString = [[NSString alloc]
- initWithBytes:title
- length:strlen(title)
- encoding:NSUTF8StringEncoding];
-
- id window = [[PuglWindow new] retain];
-
- [window setPuglview:view];
- [window setTitle:titleString];
- if (view->min_width || view->min_height) {
- [window setContentMinSize:NSMakeSize(view->min_width, view->min_height)];
+ if (view->transient_parent) {
+ NSView* pview = (NSView*)view->transient_parent;
+ [pview addSubview:impl->glview];
+ [impl->glview setHidden:NO];
+ [impl->glview setLevel: CGShieldingWindowLevel() + 1];
+ } else {
+ NSString* titleString = [[NSString alloc]
+ initWithBytes:title
+ length:strlen(title)
+ encoding:NSUTF8StringEncoding];
+
+ id window = [[RobTKPuglWindow new] retain];
+ [window setPuglview:view];
+ [window setTitle:titleString];
+ if (view->min_width || view->min_height) {
+ [window setContentMinSize:NSMakeSize(min_width, min_height)];
+ }
+ impl->window = window;
}
impl->glview = [PuglOpenGLView new];