aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-21 17:22:42 +0200
committerDavid Robillard <d@drobilla.net>2019-07-21 17:24:42 +0200
commit1ffbc79483c1e068de412cabe7e892e24033d693 (patch)
tree7ccdb47eeafd2dcfc6bb282a6afd5254b560e007 /pugl/pugl_osx.m
parentb5edd05a1ca4a91cdf91afa86efce806528a62b5 (diff)
downloadpugl-1ffbc79483c1e068de412cabe7e892e24033d693.tar.gz
pugl-1ffbc79483c1e068de412cabe7e892e24033d693.tar.bz2
pugl-1ffbc79483c1e068de412cabe7e892e24033d693.zip
Implement aspect ratio on MacOS
Unfortunately MacOS does not seem to support constraints here, so just use the minimum.
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 4a44dab..2507fcb 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -661,6 +661,11 @@ puglCreateWindow(PuglView* view, const char* title)
}
impl->window = window;
+ if (view->min_aspect_x && view->min_aspect_y) {
+ [window setContentAspectRatio:NSMakeSize(view->min_aspect_x,
+ view->min_aspect_y)];
+ }
+
[window setContentView:impl->glview];
[impl->app activateIgnoringOtherApps:YES];
[window makeFirstResponder:impl->glview];