如何将 NSView 上的点击传递到其下方的应用程序窗口?
我的应用程序在 NSWindow 中有一个 NSView,它覆盖屏幕并在其上绘制半透明阴影,在上面我有另一个 NSWindow,其中包含我的应用程序的 UI,因此全屏视图旨在淡出其他内容的背景干扰视窗。
如何允许鼠标在全屏视图上单击直接进入底层窗口,该窗口将属于另一个应用程序,甚至桌面?请注意,我不希望它继续关注我的应用程序。
My app has a NSView in a NSWindow which covers the screen and draws a semi-transparent shade on it, above that I've got another NSWindow which contains my app's UI, so the full screen view is designed to fade out background distraction of other windows.
How can I allow mouse clicks on the full screen view to go straight through to the underlying window, which will belong to another app, or even the desktop? Note that I don't want it to keep focus on my app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Matt Gemmell 的 Shady 做了完全相同的事情,看一下来源:
http://instinctivecode.com/shady/
它通过向窗口发送以下消息来实现此目的:
Shady by Matt Gemmell does exactly the same, take a look at the source:
http://instinctivecode.com/shady/
It does this by sending the following message to the window: