GTK + / X11:半透明窗口W /和W / O复合经理人? [英] Gtk+/X11: semitransparent windows w/ and w/o composite managers?

查看:507
本文介绍了GTK + / X11:半透明窗口W /和W / O复合经理人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些code使我的窗口(和preferably上的所有部件)半透明。
我知道我可以玩弄gtk_window_set_opacity(),但它只能在运行合成管理器,但如果不是呢?
我GOOGLE了很多,找到了许多code那大多甚至没有编译,不工作,或只是一个概念验证。没有充实的解决方案。我不想与X11的Xlib可怕API一塌糊涂(我根本没有时间去学习它)。

I need some code for making my window (and preferably all widgets on it) semitransparent. I know i can play around with gtk_window_set_opacity(), but it works only when composite manager is running, but what if not? I've googled a lot, found lots of code that mostly doesn't even compile, doesn't work or just a proof of concept. No fulfilling solution. I don't want to mess with X11 Xlib awful API (I just don't have time to learn it).

任何想法从哪里得到这样的库/ code段?

Any ideas where to get such library/code snippet?

感谢您。

推荐答案

有没有好的答案,这个(这就是为什么合成经理们发明了一个很好的一部分)。如果你已经可以做到这一点,人们就不会发明了全合成管理机制。

There's no good answer to this (which is a good part of why compositing managers were invented). If you could already do this, people wouldn't have invented the whole compositing manager mechanism.

唯一排序的答案,在旧的透明终端之类的使用,是基于制作的东西截图窗口下方,然后画在自己的窗口的屏幕截图。这是一个Xlib的涉一塌糊涂,难以得到基本上是正确的,不可能得到完全正确的,而且效率低下。不过,你可以做到这一点也许。看透明度,支持终端的旧版本,我想用VTE有此code,ZVT部件肯定没有。所以做例如启蒙终端。

The only sort-of answer, used in old "transparent terminals" and the like, is based on making screenshots of the stuff underneath the window and then painting the screenshot in your own window. This is an Xlib-involving mess, hard to get mostly right, impossible to get completely correct, and inefficient. Still, you could do it perhaps. Look at old revisions of terminals supporting transparency, I think VTE used to have this code, ZVT widget certainly did. So did the Enlightenment terminal for example.

但真正要走的路是只回落到不透明度为用户没有CM。

But really the way to go is to just fall back to no transparency for users without a CM.

这篇关于GTK + / X11:半透明窗口W /和W / O复合经理人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆