diff options
-rw-r--r-- | vcl/quartz/salvd.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx index 77fee8f13d8a..8de6d38ee52d 100644 --- a/vcl/quartz/salvd.cxx +++ b/vcl/quartz/salvd.cxx @@ -273,7 +273,14 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) xCGContext = [pNSContext CGContext]; } } - else + // At least on macOS 10.14 during CppunitTests (that have hidden windows), it happens + // that the above + // + // [NSGraphicsContext graphicsContextWithWindow: pNSWindow] + // + // returns nil for unclear reasons; so use the below fallback even if there is a + // pNSWindow but obtaining a graphics context for it fails: + if (xCGContext == nullptr) { // fall back to a bitmap context mnBitmapDepth = 32; |