macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.5k stars 681 forks source link

Fix crashing on 10.9 #1268

Closed ychin closed 2 years ago

ychin commented 2 years ago

This fixes MacVim to work again on OSX 10.9. It was previously crashing on launch for last few versions.

titlebarAppearsTransparent call: This API was added in 10.10, and previously MacVim wasn't properly guarding it with the proper OS version check, causing it to crash under 10.9 (which is the lowest currently supported macOS version).

CGContext call: The new stateful renderer is using a newer API to retrieve the CGContext from the NS wrapper, but that was also only added in 10.10. When compiling against older versions, just use the older, now-deprecated API "graphicsPort" instead. It still works.

Also, change the version check for safeAreaInsets for non-native full screen to use @available as well instead of checking for selector. This is more consistent with how other code works and fixes a compiler warning about not checking for OS version.

Fix #1212