简体   繁体   中英

Is there a way to get NSPanel “Non activating” style functionality on an NSWindow?

NSPanel has a “Non activating” option for HUD Panels. I'd like to get that same functionality working on an NSWindow , ie I want the window to accept clicks but not take focus away from whatever the active app is (by this I mean the app that was active before clicking on the window activated my app—in this case Sketch).

I have tried creating an NSWindow subclass and setting canBecomeMainWindow and canBecomeKeyWindow to NO but that doesn't seem to be working—I think because those settings only apply to windows within the same app .

What I'm trying to do here is prevent this flickering . I'm pretty sure this is doable as apps like Alfred seem to be doing it.

如果有其他人遇到这个,虽然不是问题的确切答案,你确实可以通过向视图控制器添加NSVisualEffectView并将其设置为NSVisualEffectView来使NSPanel变亮。

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