Transparent Window Linux


Has anyone successfully gotten transparent windows in Linux, specifically Ubuntu (20.04)?

I request the transaparency by setting GLFW_TRANSPARENT_FRAMEBUFFER to true but querying after window creation show the value to be 0.

I can force the whole window to be transparent in the OS by running

xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY `printf 0x%x $((0xfffffff * 80 / 100))`

but I can’t get GLFW to create a transparent window itself

I’m not that familiar with the transparency code but I believe the whole window transparency via _NET_WM_WINDOW_OPACITY and GLFW_TRANSPARENT_FRAMEBUFFER option which controls the use of the framebuffers alpha component to determine the window content transparency are different things.

Documentation for Window transparency covers the basics, including glfwSetWindowOpacity which like _NET_WM_WINDOW_OPACITY sets the entire Windows transparency.

On X11 I believe GLFW_TRANSPARENT_FRAMEBUFFER requires a compositing window manager and support for an alphaMask.

So it is possible your system does not support frame buffer transparency, but does support full window transparency.

Thanks, will look at a compositing window manager

I don’t use Ubuntu, but I don’t think it matters, really. It’s all about the window manager.
Xfwm (the window manager for the Xfce environment) supports transparency, and GLFW creates transparent windows without any problem. On the other hand, simple stacking window managers such as Openbox will ignore whatever opacity you set with glfwSetWindowOpacity. Same for tiling window managers such as Stumpwm.