forked from dougzilla32/CustomMenus
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When a new suggestion window opens and mouse is inside window mouseEntered causes that currently written text is hijacked and replaced with suggestion. The proper solution is to mark down lastMouseOverView and only mark it as selected when user moves mouse (need to change window settings to acceptmousemoved). Safari behaves the same.
The issue with hijack text I have with MKLocalSearchCompleter as it can give suggestions that don't match the text user has typed
override func mouseEntered(with event: NSEvent) {
lastMouseEnteredView = event.trackingArea?.userInfo?[SuggestionWindowController.trackerKey] as? NSView
// NOTE: THIS CAUSES ISSUE DURING TYPING AND MOUSE IS OVER SUGGESTION WINDOW
//userSetSelectedView(lastMouseEnteredView)
}
override func mouseMoved(with event: NSEvent) {
guard selectedView == nil, let lastMouseEnteredView else { return }
userSetSelectedView(lastMouseEnteredView)
}
/* The mouse has left one of our child image views. Set the selection to no selection and send action
*/
override func mouseExited(with event: NSEvent) {
lastMouseEnteredView = nil
guard let win = self.window, win.isVisible else { return }
userSetSelectedView(nil)
}
https://github.com/jbrayton/CustomMenus/blob/ebb88c3c87e9461410882fab31c91dde4bef9309/Suggestion List Window/SUGSuggestionListWindowController.swift#L316
Metadata
Metadata
Assignees
Labels
No labels