     }
 
     func cycleLayoutForward() {
-        currentLayoutIndex = (currentLayoutIndex + 1) % layouts.count
+        setCurrentLayoutIndex((currentLayoutIndex + 1) % layouts.count)
         setNeedsReflowWithWindowChange(.unknown)
     }
 
     func cycleLayoutBackward() {
-        currentLayoutIndex = (currentLayoutIndex == 0 ? layouts.count : currentLayoutIndex) - 1
+        setCurrentLayoutIndex((currentLayoutIndex == 0 ? layouts.count : currentLayoutIndex) - 1)
         setNeedsReflowWithWindowChange(.unknown)
     }
 

    private var layouts: [Layout<Window>] = []
    private var currentLayoutIndexBySpaceIdentifier: [String: Int] = [:]
    private var layoutsBySpaceIdentifier: [String: [Layout<Window>]] = [:]
    private var currentLayoutIndex: Int {
        didSet {
            if !self.changingSpace || userConfiguration.enablesLayoutHUDOnSpaceChange() {
                self.displayLayoutHUD()
            }
        }
    }
    var currentLayout: Layout<Window>? {
        guard !layouts.isEmpty else {
            return nil

    }

    private let layoutNameWindowController: LayoutNameWindowController

    init(screen: NSScreen, screenIdentifier: String, delegate: ScreenManagerDelegate, userConfiguration: UserConfiguration) {
        self.screen = screen
