From 0d160f85f76d18eec66d0c88edf4a284e0701675 Mon Sep 17 00:00:00 2001 From: Rio Fujita Date: Fri, 27 Mar 2026 21:07:16 +0900 Subject: [PATCH] Fix prompt window focus restoration --- .../PromptInput/PromptInputWindow.swift | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/azooKeyMac/Windows/PromptInput/PromptInputWindow.swift b/azooKeyMac/Windows/PromptInput/PromptInputWindow.swift index 861777e..0861434 100644 --- a/azooKeyMac/Windows/PromptInput/PromptInputWindow.swift +++ b/azooKeyMac/Windows/PromptInput/PromptInputWindow.swift @@ -16,7 +16,6 @@ final class PromptInputWindow: NSWindow { private var applyCallback: ((String) -> Void)? private var isTextFieldCurrentlyFocused: Bool = false private var initialPrompt: String? - private var previousApp: NSRunningApplication? init() { super.init( @@ -92,12 +91,6 @@ final class PromptInputWindow: NSWindow { self.applyCallback = onApply self.completion = completion self.initialPrompt = initialPrompt - let frontmostApp = NSWorkspace.shared.frontmostApplication - if let frontmostApp, frontmostApp.processIdentifier != NSRunningApplication.current.processIdentifier { - self.previousApp = frontmostApp - } else { - self.previousApp = nil - } // Reset the window display state resetWindowState() @@ -168,18 +161,6 @@ final class PromptInputWindow: NSWindow { } override func close() { - // Call completion handler to reset flags before closing - if let completion = self.completion { - completion(nil) - } - - // Restore focus to the previous application - if let previousApp = self.previousApp { - DispatchQueue.main.async { - previousApp.activate(options: []) - } - } - super.close() self.completion = nil self.previewCallback = nil