Ticket #65354: patch-safeAreaInsets-fix.diff
File patch-safeAreaInsets-fix.diff, 2.2 KB (added by Gandoon (Erik Hedlund), 2 years ago) |
---|
-
sources/NSScreen+iTerm.m
old new 93 93 } 94 94 95 95 - (CGFloat)notchHeight { 96 if (@available(macOS 12.0, *)) { 97 return self.safeAreaInsets.top; 98 } 96 // safeAreaInsets has proven to be absent and fail to compile on macOS 10.15.7 (Darwin 19.6.0), and indications of 97 // issues on later systems have been seen and reported in https://trac.macports.org/ticket/63824 98 // Commenting this out avoids the problem on these pre-notched Macs. See also below in it_menuBarHeight. 99 // if (@available(macOS 12.0, *)) { 100 // return self.safeAreaInsets.top; 101 // } 99 102 return 0; 100 103 } 101 104 … … 107 110 } 108 111 109 112 - (CGFloat)it_menuBarHeight { 110 if (@available(macOS 12, *)) {113 // if (@available(macOS 12, *)) { 111 114 // When the "current" screen has a notch, there doesn't seem to be a way to get the height 112 115 // of the menu bar on other screens :( 113 return MAX(24, self.safeAreaInsets.top);114 }116 // return MAX(24, self.safeAreaInsets.top); 117 // } 115 118 return NSApp.mainMenu.menuBarHeight; 116 119 } 117 120 -
sources/iTermRootTerminalView.m
old new 1252 1252 if (fakeHeight > 0) { 1253 1253 return fakeHeight; 1254 1254 } 1255 if (@available(macOS 12, *)) { 1256 // self.safeAreaInsets is all 0s on a notch Mac. Why the hell doesn't anything work right? 1257 const NSEdgeInsets safeAreaInsets = self.window.screen.safeAreaInsets; 1258 return safeAreaInsets.top; 1259 } 1255 1256 // safeAreaInsets has proven to be absent and fail to compile on macOS 10.15.7 (Darwin 19.6.0), and indications of 1257 // issues on later systems have been seen and reported in https://trac.macports.org/ticket/63824 1258 // Commenting this out avoids the problem on these pre-notched Macs. 1259 // if (@available(macOS 12, *)) { 1260 // // self.safeAreaInsets is all 0s on a notch Mac. Why the hell doesn't anything work right? 1261 // const NSEdgeInsets safeAreaInsets = self.window.screen.safeAreaInsets; 1262 // return safeAreaInsets.top; 1263 // } 1260 1264 return 0; 1261 1265 } 1262 1266