mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: safeAreaInsets.top includes menu
This commit is contained in:
@ -120,8 +120,11 @@ class FullScreenHandler { var previousTabGroup: NSWindowTabGroup?
|
|||||||
if (subtractMenu) {
|
if (subtractMenu) {
|
||||||
if let menuHeight = NSApp.mainMenu?.menuBarHeight {
|
if let menuHeight = NSApp.mainMenu?.menuBarHeight {
|
||||||
var padding: CGFloat = 0
|
var padding: CGFloat = 0
|
||||||
if #available(macOS 12, *) {
|
|
||||||
padding = screen.safeAreaInsets.top;
|
// Detect the notch. If there is a safe area on top it includes the
|
||||||
|
// menu height as a safe area so we also subtract that from it.
|
||||||
|
if (screen.safeAreaInsets.top > 0) {
|
||||||
|
padding = screen.safeAreaInsets.top - menuHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NSMakeRect(
|
return NSMakeRect(
|
||||||
|
Reference in New Issue
Block a user