From 6be4e4d45d5cd6f7227877892010e3c0fc2a95d0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 27 Sep 2023 22:13:55 -0700 Subject: [PATCH] Revert "macos: on Sonoma, manually add menu height padding for visible-menu" This reverts commit 1dab2f9dd3bb19f8decc30826fd75d59bf412cc2. --- macos/Sources/Helpers/FullScreenHandler.swift | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/macos/Sources/Helpers/FullScreenHandler.swift b/macos/Sources/Helpers/FullScreenHandler.swift index a85193e06..2fe650587 100644 --- a/macos/Sources/Helpers/FullScreenHandler.swift +++ b/macos/Sources/Helpers/FullScreenHandler.swift @@ -118,25 +118,8 @@ class FullScreenHandler { var previousTabGroup: NSWindowTabGroup? func calculateFullscreenFrame(screenFrame: NSRect, subtractMenu: Bool)->NSRect { if (subtractMenu) { - if let menuHeight = NSApp.mainMenu?.menuBarHeight { - var padding: CGFloat = 0 - 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) - ) - } + let menuHeight = NSApp.mainMenu?.menuBarHeight ?? 0 + return NSMakeRect(screenFrame.minX, screenFrame.minY, screenFrame.width, screenFrame.height - menuHeight) } return screenFrame }