[Xcb] Window transparency and clearing a window

Sheheryar Parvaz skipper308 at hotmail.ca
Tue Oct 17 01:04:37 UTC 2017


First of all, thank you very much for your response, it is very helpful since documentation on X11 is hard to find. In my case, I want to be able to use pseudo-transparency and true transparency depending on what is available, so help on both methods is appreciated.


> You want a window with depth 32. If you have that (and correctly tell
> cairo about it), you can just cairo to draw a transparent background
> [1].


For true transparency, I can't seem to set the depth properly using xcb_create_window(...), since I have no idea what unit the depth parameter is even supposed to be! Giving it 32 does not work, the only value that seems to work for me is XCB_COPY_FROM_PARENT. Essentially, I have no idea if my window already has a depth of 32-bit or not.

I'm assuming it isn't since cairo seems to be drawing a black background. By the way, the only mask I have set is CW_EVENT_MASK. This could be the reason why, but I have no idea.


I am also having trouble thinking about how to do pseudo-transparency. For now, I am copying the root pixmap to the window, then telling cairo to draw over it, using the default cairo operator. However, once the root pixmap changes, I would have to copy the pixmap then redo the drawing process. This is not the most efficient way, and I'm curious as to if there is a better way that I haven't though of.


Thank you again, and hopefully this is the right place to discuss this.

________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xcb/attachments/20171017/6aab98db/attachment.html>


More information about the Xcb mailing list