diff --git a/Downterm/CommandNotch.xcodeproj/project.xcworkspace/xcuserdata/harvmaster.xcuserdatad/UserInterfaceState.xcuserstate b/Downterm/CommandNotch.xcodeproj/project.xcworkspace/xcuserdata/harvmaster.xcuserdatad/UserInterfaceState.xcuserstate index 61f3b75..ae272fa 100644 Binary files a/Downterm/CommandNotch.xcodeproj/project.xcworkspace/xcuserdata/harvmaster.xcuserdatad/UserInterfaceState.xcuserstate and b/Downterm/CommandNotch.xcodeproj/project.xcworkspace/xcuserdata/harvmaster.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Downterm/CommandNotch/ContentView.swift b/Downterm/CommandNotch/ContentView.swift index 507497e..f96a446 100644 --- a/Downterm/CommandNotch/ContentView.swift +++ b/Downterm/CommandNotch/ContentView.swift @@ -160,6 +160,7 @@ struct ContentView: View { } else { hoverTask?.cancel() withAnimation(hoverAnimation) { vm.isHovering = false } + vm.clearHoverOpenSuppression() } } @@ -168,6 +169,7 @@ struct ContentView: View { guard openNotchOnHover, vm.notchState == .closed, !vm.isCloseTransitionActive, + !vm.suppressHoverOpenUntilHoverExit, vm.isHovering else { return } hoverTask = Task { @MainActor in @@ -175,7 +177,8 @@ struct ContentView: View { guard !Task.isCancelled, vm.isHovering, vm.notchState == .closed, - !vm.isCloseTransitionActive else { return } + !vm.isCloseTransitionActive, + !vm.suppressHoverOpenUntilHoverExit else { return } vm.requestOpen?() } } diff --git a/Downterm/CommandNotch/Models/NotchViewModel.swift b/Downterm/CommandNotch/Models/NotchViewModel.swift index 6f52206..7e90f1c 100644 --- a/Downterm/CommandNotch/Models/NotchViewModel.swift +++ b/Downterm/CommandNotch/Models/NotchViewModel.swift @@ -12,6 +12,7 @@ class NotchViewModel: ObservableObject { @Published var closedNotchSize: CGSize @Published var isHovering: Bool = false @Published var isCloseTransitionActive: Bool = false + @Published var suppressHoverOpenUntilHoverExit: Bool = false let terminalManager = TerminalManager.shared @@ -74,6 +75,9 @@ class NotchViewModel: ObservableObject { func beginCloseTransition() { closeTransitionTask?.cancel() isCloseTransitionActive = true + if isHovering { + suppressHoverOpenUntilHoverExit = true + } let delay = closeInteractionLockDuration closeTransitionTask = Task { @MainActor [weak self] in @@ -90,6 +94,10 @@ class NotchViewModel: ObservableObject { isCloseTransitionActive = false } + func clearHoverOpenSuppression() { + suppressHoverOpenUntilHoverExit = false + } + deinit { closeTransitionTask?.cancel() }