1234567891011121314151617181920212223242526272829 |
- //
- // KMApplication.swift
- // PDF Master
- //
- // Created by liujiajie on 2024/1/16.
- //
- import Cocoa
- let SKApplicationStartsTerminatingNotification = "SKApplicationStartsTerminatingNotification"
- @objc protocol KMApplicationDelegate: NSApplicationDelegate {
- @objc optional func applicationStartsTerminating(_ aNotification: NSNotification)
-
- }
- class KMApplication: NSApplication{
- var userAttentionDisabled = false
- var adelegate: KMApplicationDelegate?
-
- func updatePresentationOptions(for aWindow: NSWindow) {
- let options: [NSApplication.PresentationOptions] = [[], .autoHideDock, .autoHideMenuBar, .fullScreen, .hideDock, .hideMenuBar, .disableProcessSwitching]
- let mode = aWindow.windowController?.document?.systemInteractionMode()
- if self.presentationOptions != options[mode?.rawValue ?? 0] {
- self.presentationOptions = options[mode?.rawValue ?? 0]
- }
- }
-
- }
|