Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Mos/Managers/WindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ extension WindowManager {
showWindow(withIdentifier: identifier, withTitle: title)
return
}
// 显示
// 取消显示 Dock 图标并激活 App,保留 accessory 模式避免切换 space
// Utils.showDockIcon()
NSApp.activate(ignoringOtherApps: true)

// 显示并前置窗口
windowController.showWindow(self)
// 前置并激活(已打开窗口也要置顶)
if let window = windowController.window {
if window.isMiniaturized {
window.deminiaturize(self)
}
window.makeKeyAndOrderFront(self)
window.orderFrontRegardless()
}
NSApp.activate(ignoringOtherApps: true)
// 显示 Dock 图标
Utils.showDockIcon()
}
// 关闭对应 Identifier 的窗口
func hideWindow(withIdentifier identifier: String, destroy: Bool = false) {
// 隐藏 Dock 图标
Utils.hideDockIcon()
// Utils.hideDockIcon()
// 销毁实例
if destroy {
refs.removeValue(forKey: identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class PreferencesWindowController: NSWindowController, NSWindowDelegate {

override func windowDidLoad() {
super.windowDidLoad()

// Allow the window to appear on the current active space, including fullscreen apps
window?.collectionBehavior = [.moveToActiveSpace, .fullScreenAuxiliary]

// 插入分隔符
if #available(OSX 10.16, *) {
window?.toolbar?.insertItem(withItemIdentifier: NSToolbarItem.Identifier.flexibleSpace, at: 4)
Expand Down