diff --git a/Amethyst/Managers/ScreenManager.swift b/Amethyst/Managers/ScreenManager.swift index 9f08b661..7e90e0b9 100644 --- a/Amethyst/Managers/ScreenManager.swift +++ b/Amethyst/Managers/ScreenManager.swift @@ -313,7 +313,7 @@ final class ScreenManager: NSObject, Codable { return } - let screenFrame = screen.frameIncludingDockAndMenu() + let screenFrame = screen.frame() let screenCenter = CGPoint(x: screenFrame.midX, y: screenFrame.midY) let windowOrigin = CGPoint( x: screenCenter.x - layoutNameWindow.frame.width / 2.0, diff --git a/Amethyst/Model/Screen.swift b/Amethyst/Model/Screen.swift index 7c450b46..856344e1 100644 --- a/Amethyst/Model/Screen.swift +++ b/Amethyst/Model/Screen.swift @@ -40,6 +40,9 @@ protocol ScreenType: Equatable { /// The frame adjusted such that the dock and menu are not included. func frameWithoutDockOrMenu() -> CGRect + /// The frame without adjustment. + func frame() -> CGRect + /// The opaque idenfitifer for the screen in the underlying graphics system. func screenID() -> String? @@ -119,6 +122,10 @@ struct AMScreen: ScreenType { return screen.frameWithoutDockOrMenu() } + func frame() -> CGRect { + return screen.frame + } + func screenID() -> String? { guard let managedDisplay = CGSCopyBestManagedDisplayForRect(CGSMainConnectionID(), frameIncludingDockAndMenu()) else { return nil diff --git a/AmethystTests/Model/TestScreen.swift b/AmethystTests/Model/TestScreen.swift index d4d25e84..25f844c5 100644 --- a/AmethystTests/Model/TestScreen.swift +++ b/AmethystTests/Model/TestScreen.swift @@ -42,6 +42,10 @@ final class TestScreen: ScreenType { return internalFrame } + func frame() -> CGRect { + return internalFrame + } + func screenID() -> String? { return id }