Просмотр исходного кода

Cocoa: Remove support for OS X 10.10 Yosemite

Fixes #2506
Camilla Löwy 1 год назад
Родитель
Сommit
8b574030a8
6 измененных файлов с 9 добавлено и 17 удалено
  1. 1 1
      .github/workflows/build.yml
  2. 2 1
      README.md
  3. 2 2
      include/GLFW/glfw3.h
  4. 3 3
      src/cocoa_monitor.m
  5. 0 6
      src/cocoa_window.m
  6. 1 4
      src/nsgl_context.m

+ 1 - 1
.github/workflows/build.yml

@@ -54,7 +54,7 @@ jobs:
         timeout-minutes: 4
         timeout-minutes: 4
         env:
         env:
             CFLAGS: -Werror
             CFLAGS: -Werror
-            MACOSX_DEPLOYMENT_TARGET: 10.8
+            MACOSX_DEPLOYMENT_TARGET: 10.11
             CMAKE_OSX_ARCHITECTURES: x86_64;arm64
             CMAKE_OSX_ARCHITECTURES: x86_64;arm64
         steps:
         steps:
             - uses: actions/checkout@v4
             - uses: actions/checkout@v4

+ 2 - 1
README.md

@@ -79,7 +79,7 @@ more information.
 
 
 ## System requirements
 ## System requirements
 
 
-GLFW supports Windows XP and later and macOS 10.8 and later.  Linux and other
+GLFW supports Windows XP and later and macOS 10.11 and later.  Linux and other
 Unix-like systems running the X Window System are supported even without
 Unix-like systems running the X Window System are supported even without
 a desktop environment or modern extensions, although some features require
 a desktop environment or modern extensions, although some features require
 a running window or clipboard manager.  The OSMesa backend requires Mesa 6.3.
 a running window or clipboard manager.  The OSMesa backend requires Mesa 6.3.
@@ -123,6 +123,7 @@ information on what to include when reporting a bug.
 
 
  - Added `GLFW_UNLIMITED_MOUSE_BUTTONS` input mode that allows mouse buttons beyond
  - Added `GLFW_UNLIMITED_MOUSE_BUTTONS` input mode that allows mouse buttons beyond
    the limit of the mouse button tokens to be reported (#2423)
    the limit of the mouse button tokens to be reported (#2423)
+ - [Cocoa] Removed support for OS X 10.10 Yosemite and earlier (#2506)
  - [Wayland] Bugfix: The fractional scaling related objects were not destroyed
  - [Wayland] Bugfix: The fractional scaling related objects were not destroyed
  - [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
  - [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
  - [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
  - [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`

+ 2 - 2
include/GLFW/glfw3.h

@@ -3183,8 +3183,8 @@ GLFWAPI void glfwWindowHintString(int hint, const char* value);
  *
  *
  *  [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
  *  [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
  *
  *
- *  @remark @macos On OS X 10.10 and later the window frame will not be rendered
- *  at full resolution on Retina displays unless the
+ *  @remark @macos The window frame will not be rendered at full resolution on
+ *  Retina displays unless the
  *  [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint)
  *  [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint)
  *  hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
  *  hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
  *  application bundle's `Info.plist`.  For more information, see
  *  application bundle's `Info.plist`.  For more information, see

+ 3 - 3
src/cocoa_monitor.m

@@ -137,7 +137,7 @@ static GLFWbool modeIsGood(CGDisplayModeRef mode)
     if (flags & kDisplayModeStretchedFlag)
     if (flags & kDisplayModeStretchedFlag)
         return GLFW_FALSE;
         return GLFW_FALSE;
 
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
+#if MAC_OS_X_VERSION_MAX_ALLOWED == 101100
     CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
     CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
     if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
     if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
         CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
         CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
@@ -164,7 +164,7 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
     if (result.refreshRate == 0)
     if (result.refreshRate == 0)
         result.refreshRate = (int) round(fallbackRefreshRate);
         result.refreshRate = (int) round(fallbackRefreshRate);
 
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
+#if MAC_OS_X_VERSION_MAX_ALLOWED == 101100
     CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
     CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
     if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
     if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
     {
     {
@@ -180,7 +180,7 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
         result.blueBits = 8;
         result.blueBits = 8;
     }
     }
 
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
+#if MAC_OS_X_VERSION_MAX_ALLOWED == 101100
     CFRelease(format);
     CFRelease(format);
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
     return result;
     return result;

+ 0 - 6
src/cocoa_window.m

@@ -310,7 +310,6 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
 
 
 - (void)windowDidChangeOcclusionState:(NSNotification* )notification
 - (void)windowDidChangeOcclusionState:(NSNotification* )notification
 {
 {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1090
     if ([window->ns.object respondsToSelector:@selector(occlusionState)])
     if ([window->ns.object respondsToSelector:@selector(occlusionState)])
     {
     {
         if ([window->ns.object occlusionState] & NSWindowOcclusionStateVisible)
         if ([window->ns.object occlusionState] & NSWindowOcclusionStateVisible)
@@ -318,7 +317,6 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
         else
         else
             window->ns.occluded = GLFW_TRUE;
             window->ns.occluded = GLFW_TRUE;
     }
     }
-#endif
 }
 }
 
 
 @end
 @end
@@ -1950,7 +1948,6 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
 {
 {
     @autoreleasepool {
     @autoreleasepool {
 
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
     // HACK: Dynamically load Core Animation to avoid adding an extra
     // HACK: Dynamically load Core Animation to avoid adding an extra
     //       dependency for the majority who don't use MoltenVK
     //       dependency for the majority who don't use MoltenVK
     NSBundle* bundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/QuartzCore.framework"];
     NSBundle* bundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/QuartzCore.framework"];
@@ -2027,9 +2024,6 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
     }
     }
 
 
     return err;
     return err;
-#else
-    return VK_ERROR_EXTENSION_NOT_PRESENT;
-#endif
 
 
     } // autoreleasepool
     } // autoreleasepool
 }
 }

+ 1 - 4
src/nsgl_context.m

@@ -218,14 +218,11 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
         ADD_ATTRIB(kCGLPFASupportsAutomaticGraphicsSwitching);
         ADD_ATTRIB(kCGLPFASupportsAutomaticGraphicsSwitching);
     }
     }
 
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
     if (ctxconfig->major >= 4)
     if (ctxconfig->major >= 4)
     {
     {
         SET_ATTRIB(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core);
         SET_ATTRIB(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core);
     }
     }
-    else
-#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
-    if (ctxconfig->major >= 3)
+    else if (ctxconfig->major >= 3)
     {
     {
         SET_ATTRIB(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
         SET_ATTRIB(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
     }
     }