Merge branch 'fixes-fullscreen-hide-macos-10.15' of https://github.com/npearson72/kitty

This commit is contained in:
Kovid Goyal 2022-01-11 20:09:10 +05:30
commit fd1b64dcc6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2302,7 +2302,7 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor UNUSED)
bool _glfwPlatformIsFullscreen(_GLFWwindow* w, unsigned int flags) {
NSWindow *window = w->ns.object;
bool traditional = !(flags & 1);
if (traditional) { if(@available(macOS 11.0, *)) return w->ns.in_traditional_fullscreen; }
if (traditional) { if(@available(macOS 10.15.7, *)) return w->ns.in_traditional_fullscreen; }
NSWindowStyleMask sm = [window styleMask];
return sm & NSWindowStyleMaskFullScreen;
}
@ -2313,8 +2313,9 @@ bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) {
bool traditional = !(flags & 1);
NSWindowStyleMask sm = [window styleMask];
if (traditional) {
if (@available(macOS 11.0, *)) {
if (@available(macOS 10.15.7, *)) {
// As of Big Turd NSWindowStyleMaskFullScreen is no longer useable
// Also no longer compatible after a minor release of macOS 10.15.7
if (!w->ns.in_traditional_fullscreen) {
w->ns.pre_full_screen_style_mask = sm;
[window setStyleMask: NSWindowStyleMaskBorderless];