简体   繁体   English

重新设置 WM 中的不透明度

[英]Opacity in a reparenting WM

I'm writing a reparenting window manager for X11 (and have asked a number of questions about it here already).我正在为 X11 编写一个重命名的 window 管理器(并且已经在这里问了很多关于它的问题)。 Right now, the issue I'm having isn't so much a bug to fix as much as a question on how to implement something.现在,我遇到的问题与其说是一个需要修复的错误,不如说是一个关于如何实现某些东西的问题。

Applications can request transparency, and if a compositor like xcompmgr or picom is running, they will provide it.应用程序可以请求透明度,如果 xcompmgr 或 picom 之类的合成器正在运行,它们将提供它。 However, this doesn't seem to work when I reparent the window;但是,当我重新设置 window 时,这似乎不起作用; in this case the client window's background just shows a black background behind (maybe the frame window? but the background of that isn't black).在这种情况下,客户端窗口的背景只是在后面显示黑色背景(可能是框架 window?但它的背景不是黑色)。 I do indicate I have a frame by setting .NET_FRAME_EXTENTS.我确实通过设置 .NET_FRAME_EXTENTS 来指示我有一个框架。

What I've tried:我试过的:

  • It looks like awesomewm's code for opacity listens to a property notify with a .NET_WM_OPACITY.看起来 awesomewm 的不透明度代码会监听一个带有 .NET_WM_OPACITY 的属性通知。 I don't get any PropertyNotify event when I change opacity of a window, despite selecting SubstructureRedirect|SubstructureNotify|PropertyChange on the root window.尽管在根 window 上选择了 SubstructureRedirect|SubstructureNotify|PropertyChange,但当我更改 window 的不透明度时,我没有收到任何 PropertyNotify 事件。

You need to create your frame window with reparenting with depth=32 (ie: Made to work with transparency).您需要创建您的框架 window 并重新设置深度 = 32(即:使用透明度)。 Since you are already looking at AwesomeWM: It finds the right visual for this at startup and then creates all of its windows this way.由于您已经在查看 AwesomeWM:它会在启动时为此找到正确的视觉效果,然后以这种方式创建其所有windows。 That is only necessary since Lua code might want transparency.这是唯一必要的,因为 Lua 代码可能需要透明度。 AFAIR, other WMs look at the program's window bit depth and create their frame window based on that. AFAIR,其他 WM 查看程序的 window 位深度并基于此创建其帧 window。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM