You are not logged in.

#1 2016-03-22 21:57:34

Ploppz
Member
Registered: 2013-09-14
Posts: 311

[Xlib] trying to get some simple compositing to work.

I need to do compositing within a window - drawing child windows with transparency. So I try to use compositing to draw the windows to their parent: https://bpaste.net/show/258097a90afb but it doesn't draw anything to the parent window. Is it incorrect to do it like this? Couldn't find other helpful sources on how to do this, other than this. XCompositeRedirectSubwindows doesn't draw the parent_window to a back buffer, right?

So in my main file, I make a window main_window, and two descendants demo_window and test_window.

Compositor C(main_window, dpy);
C.AddWindow(demo_window);
C.AddWindow(test_window);
while (true) {
    C.Compose();   
}

If I comment out this code, the windows are drawn to the parent window, but of course with transparency disabled. Maybe I'm using XRenderComposite incorrectly. I did make a guess that I could just use the Picture of the parent_window as destination Picture.

Last edited by Ploppz (2016-03-22 21:58:24)

Offline

#2 2016-03-22 22:03:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [Xlib] trying to get some simple compositing to work.

Are you sure you need that kind of compositing?  If all of the windows are under your program's control, you can just use a parent-relative pixmap background for the child windows: no need for composite or xrender extensions, e.g.:

XSetWindowBackgroundPixmap(display, demo_window, ParentRelative);

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-03-22 22:23:29

Ploppz
Member
Registered: 2013-09-14
Posts: 311

Re: [Xlib] trying to get some simple compositing to work.

I'm writing a screensaver daemon, and want to draw a login menu on top of the demo window. There are separate processes drawing to each child window. Both of them use OpenGL to draw. So I think I can't do that.

Offline

Board footer

Powered by FluxBB