KMBrowserWindow.swift 657 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // KMBrowserWindow.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2024/4/1.
  6. //
  7. import Cocoa
  8. class KMBrowserWindow: CTBrowserWindow {
  9. override func sendEvent(_ event: NSEvent) {
  10. if event.type == .leftMouseDown || event.type == .rightMouseDown || event.type == .keyDown {
  11. KMImageToolTipWindow.shared.orderOut(nil)
  12. }
  13. super.sendEvent(event)
  14. }
  15. override func resignMain() {
  16. KMImageToolTipWindow.shared.orderOut(nil)
  17. super.resignMain()
  18. }
  19. override func resignKey() {
  20. KMImageToolTipWindow.shared.orderOut(nil)
  21. super.resignKey()
  22. }
  23. }