Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/core/resourcedata_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,9 @@
SingleFontData fontData;
@autoreleasepool
{
NSFont* systemFont = nil;
if (@available(macOS 10.15, *)) {
systemFont = [NSFont monospacedSystemFontOfSize:13.0 weight:NSFontWeightRegular]; // Use a default size
}


if (!systemFont) {
// Fallback for older macOS versions
systemFont = [NSFont systemFontOfSize:13.0];
}

if (!systemFont)
// Double check after fallback
// monospacedSystemFontOfSize:weight: requires macOS 10.15 (our baseline).
NSFont* systemFont = [NSFont monospacedSystemFontOfSize:13.0 weight:NSFontWeightRegular];
if (!systemFont)
throw std::runtime_error("Failed to get system font");

CTFontRef ctFont = (__bridge CTFontRef)systemFont;
Expand Down
6 changes: 4 additions & 2 deletions src/window/cocoa/cocoa_display_window.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ typedef VkResult(VKAPI_PTR* PFN_vkCreateMetalSurfaceEXT)(
#endif

#ifdef HAVE_OPENGL
#define GL_SILENCE_DEPRECATION
#import <OpenGL/gl.h>
#import <OpenGL/glu.h>

#define GL_SILENCE_DEPRECATION
#endif

// Forward declarations
Expand Down Expand Up @@ -637,6 +636,8 @@ - (void)windowDidResize:(NSNotification *)notification
void CocoaDisplayWindowImpl::initOpenGL(ZWidgetView* view)
{
#ifdef HAVE_OPENGL
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSOpenGLPixelFormatAttribute attrs[] = { NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFAColorSize, 24, NSOpenGLPFAAlphaSize, 8, NSOpenGLPFADepthSize, 24, 0 };
NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
openglContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
Expand All @@ -649,6 +650,7 @@ - (void)windowDidResize:(NSNotification *)notification
{
renderAPI = RenderAPI::Bitmap; // Fallback if OpenGL not available
}
#pragma clang diagnostic pop
#else
renderAPI = RenderAPI::Bitmap; // Fallback if OpenGL not available
#endif
Expand Down
Loading