MacOSX/Cocoa:如何更改桌面内容视图/如何直接在桌面背景上绘制?

发布于 2024-12-21 06:16:23 字数 207 浏览 1 评论 0原文

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background 将桌面背景视图更改为屏幕保护程序视图。

这是如何实施的?

(如何)我可以自己做这件事吗?

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background changes the desktop background view to the screensaver view.

How is that implemented?

(How) can I do this myself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

她说她爱他 2024-12-28 06:16:23

将窗口级别设置为kCGDesktopWindowLevel,它将显示在桌面图片的顶部、图标的下方。您可能还想告诉窗口忽略鼠标单击,除非您想让桌面的某些部分不可单击。

(澄清一下:我还没有检查过,但我有点怀疑这实际上是 ScreenSaverEngine 的伎俩。苹果可以以你无法做到的方式将其应用程序相互混合——例如,许多系统提供的应用程序菜单附加功能一半在其 .menu 包中实现,一半在 SystemUIServer 主机进程中实现,但这种技术可以获得您正在寻找的效果。)

Set a window's level as kCGDesktopWindowLevel and it will appear on top of the desktop picture but under the icons. You'll probably also want to tell the window to ignore mouse clicks unless you want to render portions of the desktop unclickable.

(To clarify: I haven't checked, but I kind of doubt this is actually how the ScreenSaverEngine does its trick. Apple can mingle its apps with each other in ways that you can't — for example, many of the system-provided Menu Extras are half implemented in their .menu bundles and half in the SystemUIServer host process. But this technique gets the effect you're looking for.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文