简体   繁体   中英

How do I disable my application from participating in the ⌘+tab cycle on macOS?

I'm trying to write a small utility that attaches itself to the current main/key window. I've managed to make sure that the window cannot become key or main window, but it still shows up in the list of active applications when I use ⌘+tab .

The application should still be in the dock (so you can quit it and do other interactions), but I would rather that it didn't show up in the application list when pressing ⌘+tab .

I thought I had the answer when I discovered NSApplicationPresentationDisableProcessSwitching , but alas, that's system wide(!) which is certainly is not what I want.

Add "Application is an agent (UIElement)" to the Info.plist (raw key: NSUIElement ) to remove yourself from the dock. Then create a status bar item ( NSStatusItem ) to hold your menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM