fix(speedtest): try to fix speedtest button click issue

This commit is contained in:
yicheng 2020-02-22 14:26:15 +08:00
parent a969b4ec00
commit 6ad586d446

View File

@ -86,6 +86,14 @@ class MenuItemBaseView: NSView {
labels.forEach { updateBackground($0) }
}
override func viewWillMove(toWindow newWindow: NSWindow?) {
super.viewWillMove(toWindow: newWindow)
if let newWindow = newWindow,!newWindow.isKeyWindow {
newWindow.becomeKey()
}
updateTrackingAreas()
}
override func viewDidMoveToWindow() {
super.viewDidMoveToWindow()
}
@ -101,7 +109,9 @@ class MenuItemBaseView: NSView {
}
override func mouseUp(with event: NSEvent) {
didClickView()
DispatchQueue.main.async {
self.didClickView()
}
}
override func updateTrackingAreas() {