diff --git a/DockDoor.xcodeproj/project.pbxproj b/DockDoor.xcodeproj/project.pbxproj index b62b10f..8f1f39f 100644 --- a/DockDoor.xcodeproj/project.pbxproj +++ b/DockDoor.xcodeproj/project.pbxproj @@ -781,7 +781,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.4; + CURRENT_PROJECT_VERSION = 1.5; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"DockDoor/Preview Content\""; DEVELOPMENT_TEAM = 2Q775S63Q3; @@ -798,7 +798,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.4; + MARKETING_VERSION = 1.5; PRODUCT_BUNDLE_IDENTIFIER = com.ethanbills.DockDoor; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -815,7 +815,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.4; + CURRENT_PROJECT_VERSION = 1.5; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"DockDoor/Preview Content\""; DEVELOPMENT_TEAM = 2Q775S63Q3; @@ -832,7 +832,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 1.4; + MARKETING_VERSION = 1.5; PRODUCT_BUNDLE_IDENTIFIER = com.ethanbills.DockDoor; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/DockDoor/Views/Hover Window/WindowPreview Supporting/WindowDismissalContainer.swift b/DockDoor/Views/Hover Window/WindowPreview Supporting/WindowDismissalContainer.swift index cfdec25..8d8a525 100644 --- a/DockDoor/Views/Hover Window/WindowPreview Supporting/WindowDismissalContainer.swift +++ b/DockDoor/Views/Hover Window/WindowPreview Supporting/WindowDismissalContainer.swift @@ -30,7 +30,6 @@ class MouseTrackingNSView: NSView { private var globalMouseMonitor: Any? private var inactivityTimer: Timer? - private let baseDistanceThreshold: CGFloat = 600 private let inactivityTimeout: TimeInterval = 10.0 init(appName: String, mouseLocation: CGPoint, bestGuessMonitor: NSScreen, dockPosition: DockPosition, frame frameRect: NSRect = .zero) { @@ -41,7 +40,6 @@ class MouseTrackingNSView: NSView { fadeOutDuration = Defaults[.fadeOutDuration] super.init(frame: frameRect) setupTrackingArea() - setupMouseMonitors() setupGlobalMouseMonitor() } @@ -75,26 +73,6 @@ class MouseTrackingNSView: NSView { } } - private func setupMouseMonitors() { - // The trackingTimer is used to track any lingering cases where the user does not interact with the window at all. - // In such cases, we hide the window if it goes a decent distance from the initial location of the dock icon. - // We use a timer to poll the mosue location as global and local mouse listeners are unreliable inside views. - let dist = dockPosition == .bottom ? bestGuessMonitor.frame.height * 0.5 : bestGuessMonitor.frame.width * 0.5 - trackingTimer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { [weak self] _ in - guard let self else { return } - checkMouseDistance(dist: dist) - } - } - - private func checkMouseDistance(dist: CGFloat) { - let currentMousePosition = DockObserver.cgPointFromNSPoint(NSEvent.mouseLocation, forScreen: bestGuessMonitor) - if currentMousePosition.distance(to: mouseLocation) > dist { - DispatchQueue.main.async { [weak self] in - self?.hideWindow() - } - } - } - deinit { clearTimers() if let monitor = globalMouseMonitor {