Allow an NSWindow (NSPanel) to float above full screen apps

前端 未结 3 1901
醉梦人生
醉梦人生 2021-02-10 00:09

I\'m trying to add a little window that provides \"quick input\" from any place in the system to the main app.

The user could hit a hotkey, the window pops up, and float

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-10 00:54

    And the Swift 4.0 translation is this.. I am still testing this, but it seems to be working.

    self.view.window?.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.mainMenuWindow)))
    self.view.window?.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary]
    

提交回复
热议问题