aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-07 21:19:24 -0400
committerDavid Robillard <d@drobilla.net>2022-06-07 21:19:24 -0400
commitce5b4cdba3fffac81bfa7ee4a3bffd99fe7f9935 (patch)
tree297d825de02b07e30481b13fec0677307ee66849 /src/mac.m
parent9352879b5f95c683f406bf866fd81df02fe7429b (diff)
downloadpugl-ce5b4cdba3fffac81bfa7ee4a3bffd99fe7f9935.tar.gz
pugl-ce5b4cdba3fffac81bfa7ee4a3bffd99fe7f9935.tar.bz2
pugl-ce5b4cdba3fffac81bfa7ee4a3bffd99fe7f9935.zip
Make puglRealize() always gracefully fail with a bad configuration
Diffstat (limited to 'src/mac.m')
-rw-r--r--src/mac.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mac.m b/src/mac.m
index 2a54134..4f5c08f 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -1007,10 +1007,15 @@ PuglStatus
puglRealize(PuglView* view)
{
PuglInternals* impl = view->impl;
+
if (impl->wrapperView) {
return PUGL_FAILURE;
}
+ if (!view->backend || !view->backend->configure) {
+ return PUGL_BAD_BACKEND;
+ }
+
const NSScreen* const screen = [NSScreen mainScreen];
const double scaleFactor = [screen backingScaleFactor];