mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
57 lines
1.6 KiB
Diff
57 lines
1.6 KiB
Diff
commit 79f105b6d09a084bcba92713cb6a1f3f0fc4277d
|
|
Author: Michael Klein <michael@fossekall.de>
|
|
Date: Sun Jan 15 12:47:59 2023 +0100
|
|
|
|
Fix XCode 12 compile error
|
|
|
|
error: property 'safeAreaInsets' not found on object of type 'NSScreen *'
|
|
|
|
diff --git a/sources/NSScreen+iTerm.m b/sources/NSScreen+iTerm.m
|
|
index 666abfdd0..ea64a4f22 100644
|
|
--- sources/NSScreen+iTerm.m
|
|
+++ sources/NSScreen+iTerm.m
|
|
@@ -93,9 +93,11 @@
|
|
}
|
|
|
|
- (CGFloat)notchHeight {
|
|
+#ifdef MAX_OS_VERSION_12_0
|
|
if (@available(macOS 12.0, *)) {
|
|
return self.safeAreaInsets.top;
|
|
}
|
|
+#endif
|
|
return 0;
|
|
}
|
|
|
|
@@ -107,11 +109,13 @@
|
|
}
|
|
|
|
- (CGFloat)it_menuBarHeight {
|
|
+#ifdef MAX_OS_VERSION_12_0
|
|
if (@available(macOS 12, *)) {
|
|
// When the "current" screen has a notch, there doesn't seem to be a way to get the height
|
|
// of the menu bar on other screens :(
|
|
return MAX(24, self.safeAreaInsets.top);
|
|
}
|
|
+#endif
|
|
return NSApp.mainMenu.menuBarHeight;
|
|
}
|
|
|
|
diff --git a/sources/iTermRootTerminalView.m b/sources/iTermRootTerminalView.m
|
|
index 618764c38..55285f4fc 100644
|
|
--- sources/iTermRootTerminalView.m
|
|
+++ sources/iTermRootTerminalView.m
|
|
@@ -1252,11 +1252,13 @@ NS_CLASS_AVAILABLE_MAC(10_14)
|
|
if (fakeHeight > 0) {
|
|
return fakeHeight;
|
|
}
|
|
+#ifdef MAC_OS_VERSION_12_0
|
|
if (@available(macOS 12, *)) {
|
|
// self.safeAreaInsets is all 0s on a notch Mac. Why the hell doesn't anything work right?
|
|
const NSEdgeInsets safeAreaInsets = self.window.screen.safeAreaInsets;
|
|
return safeAreaInsets.top;
|
|
}
|
|
+#endif
|
|
return 0;
|
|
}
|
|
|