在 XLib/Qt 中将窗口设为桌面
我正在尝试编写一个简单的程序来充当 Qt 中的桌面背景,除了将其设为桌面小部件之外,我已经使其一切正常。我不知道如何做到这一点,我不介意使用 XLib 或 Qt 来做到这一点,但如果有人有一些建议,我会非常高兴。
I am trying to write a simple program to act as my desktop background in Qt, I have made it all work fine apart from making it a Desktop Widget. I have no idea on how to do this, I don't mind using XLib or Qt for doing this, but if anyone has some suggestions I would be very happy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我创建了一个简单的示例,它将桌面背景填充为白色。让它绘制图像很容易。
此解决方案的问题在于,它完全覆盖了桌面环境在后台绘制的所有内容(包括图标、等离子体等)。
如果您只是想以编程方式设置新的背景图像,我会检查您的 DE 是否有相应的 API。
I have created a simple example that will fill the desktop background white. It is easy to make it draw an image.
The problem with this solution is that it completely paints over everything that your desktop environment draws in the background (including icons, plasmoids,...).
If you just want to set a new background image programmatically, I would check if your DE has an API for that.