PrusaSlicer/deps/+wxWidgets/wx-fixes.patch
2025-02-06 16:09:13 +01:00

46 lines
1.5 KiB
Diff

diff --color -urN wxWidgets-323a465e577e03f330e2e6a4c78e564d125340cb/build/cmake/lib/webview/CMakeLists.txt dep_wxWidgets/build/cmake/lib/webview/CMakeLists.txt
--- wxWidgets-323a465e577e03f330e2e6a4c78e564d125340cb/src/osx/carbon/dcscreen.cpp 2024-06-26 10:39:50.000000000 +0200
+++ dep_wxWidgets/src/osx/carbon/dcscreen.cpp 2025-01-08 14:13:51.980634573 +0100
@@ -14,6 +14,7 @@
#include "wx/osx/dcscreen.h"
#include "wx/osx/private.h"
+#include "wx/osx/private/available.h"
#include "wx/graphics.h"
wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl);
@@ -68,15 +69,26 @@
if ( subrect )
srcRect = CGRectOffset( srcRect, -subrect->x, -subrect->y ) ;
- CGImageRef image = NULL;
-
- image = CGDisplayCreateImage(kCGDirectMainDisplay);
+ CGImageRef image = nullptr;
- wxASSERT_MSG(image, wxT("wxScreenDC::GetAsBitmap - unable to get screenshot."));
-
- CGContextDrawImage(context, srcRect, image);
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
+ if ( WX_IS_MACOS_AVAILABLE(14, 4) ) // errors on lower versions of macOS 14
+ {
+ // TODO add ScreenKit implementation
+ }
+ else
+#endif // macOS 10.14+
+ {
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 150000
+ image = CGDisplayCreateImage(kCGDirectMainDisplay);
+#endif
+ }
- CGImageRelease(image);
+ if ( image != nullptr )
+ {
+ CGContextDrawImage(context, srcRect, image);
+ CGImageRelease(image);
+ }
CGContextRestoreGState(context);
#else