Skip to content

Commit

Permalink
Activate app on mouse hover (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakerwreah committed Aug 1, 2021
1 parent 915f973 commit f66cf57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Calendr/Events/EventView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ class EventView: NSView {
popover.show(relativeTo: .zero, of: view, preferredEdge: .minX)
return popover.rx.deallocated
}
.bind(with: self) { view, _ in
view.window?.makeKey()
}
.subscribe()
.disposed(by: disposeBag)
}

Expand Down
9 changes: 9 additions & 0 deletions Calendr/Main/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,15 @@ class MainViewController: NSViewController {
statusBarButton.sendAction(on: .leftMouseDown)
}

override func mouseEntered(with event: NSEvent) {

super.mouseEntered(with: event)

guard !NSApp.isActive else { return }

NSApp.activate(ignoringOtherApps: true)
}

// MARK: - Factories

private func styleButton(_ button: NSButton) {
Expand Down

0 comments on commit f66cf57

Please sign in to comment.