Skip to content

Commit 3450c50

Browse files
committed
reset에서 flush한 Input을 처리하도록 수정
다른 입력기를 사용하는 상태에서 한/A 전환 시 실제 한/A 전환이 반영되지 않고 메뉴 막대와 상태가 어긋나는 문제 수정
1 parent 2e03ada commit 3450c50

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

SokIM/AppDelegate.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// TODO: "Automatically switch to a document's input source"를 InputContext로 구현
2-
// TODO: Safari: 구글 문서, iCloud Pages 한/글/을/입/력 문제... string 가져오기? Safari에서 downgrade 하는 방법 찾기
3-
// TODO: D->M downgrade: NotificationCenter to Context & memory
4-
1+
// swiftlint:disable type_body_length
52
import Cocoa
63
import InputMethodKit
74

@@ -181,7 +178,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
181178
eventContext.strategy.flush(from: state, to: sender)
182179
}
183180
if withInputMonitor {
184-
inputMonitor.flush()
181+
var inputs = inputMonitor.flush()
182+
filterContexts(&inputs)
183+
inputs.forEach { state.next($0) }
185184
}
186185
state = State(engine: state.engine)
187186
if getKeyboardCapsLock() {
@@ -333,6 +332,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
333332
}
334333
}
335334

335+
/** 암호 입력 필드를 위한 ABC 입력기 제한 기능 */
336336
@objc private func suppressABC(_ aNotification: Notification) {
337337
debug("\(String(describing: aNotification))")
338338

@@ -387,10 +387,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
387387

388388
guard IsSecureEventInputEnabled() else { return }
389389

390+
resetWithInputMonitor()
390391
state.engine = state.engines.A
391392
statusBar.setEngine(state.engines.A)
392-
resetWithInputMonitor()
393393

394394
debug("abcOnSecureInput 성공")
395395
}
396396
}
397+
// swiftlint:enable type_body_length

0 commit comments

Comments
 (0)