mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Revert "macos: on Sonoma, manually add menu height padding for visible-menu"
This reverts commit 1dab2f9dd3bb19f8decc30826fd75d59bf412cc2.
This commit is contained in:
@ -118,25 +118,8 @@ class FullScreenHandler { var previousTabGroup: NSWindowTabGroup?
|
|||||||
|
|
||||||
func calculateFullscreenFrame(screenFrame: NSRect, subtractMenu: Bool)->NSRect {
|
func calculateFullscreenFrame(screenFrame: NSRect, subtractMenu: Bool)->NSRect {
|
||||||
if (subtractMenu) {
|
if (subtractMenu) {
|
||||||
if let menuHeight = NSApp.mainMenu?.menuBarHeight {
|
let menuHeight = NSApp.mainMenu?.menuBarHeight ?? 0
|
||||||
var padding: CGFloat = 0
|
return NSMakeRect(screenFrame.minX, screenFrame.minY, screenFrame.width, screenFrame.height - menuHeight)
|
||||||
if #available(macOS 14, *) {
|
|
||||||
// Sonoma appears to return the menuBarHeight without including the
|
|
||||||
// padding around it (that was added in macOS 14). I've reported this
|
|
||||||
// bug as FB13210000. Until that is fixed, we just hardcode this value
|
|
||||||
// that I measured using the screenshot tool. I don't know if the
|
|
||||||
// padding can be changed in any way or if there is a way to get it
|
|
||||||
// via API but I could not find a solution.
|
|
||||||
padding = 13
|
|
||||||
}
|
|
||||||
|
|
||||||
return NSMakeRect(
|
|
||||||
screenFrame.minX,
|
|
||||||
screenFrame.minY,
|
|
||||||
screenFrame.width,
|
|
||||||
screenFrame.height - (menuHeight + padding)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return screenFrame
|
return screenFrame
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user