diff options
author | Robin Gareus <robin@gareus.org> | 2014-11-01 00:48:15 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-16 18:31:22 -0500 |
commit | 3d27fe91f5c25405df0d332f17a7c6fc97d7da27 (patch) | |
tree | 6cc51b46304e526fc86f4082eb387e003e3ca059 /pugl/pugl_osx.m | |
parent | 715d42eeb66c771628c21a60fbcf3893e1896101 (diff) |
Add support for transient child windows.
No Windows support currently.
Conflicts:
pugl/pugl.h
pugl/pugl_osx.m
pugl/pugl_win.cpp
pugl/pugl_x11.c
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r-- | pugl/pugl_osx.m | 30 |
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]; |