opengl windows bugged placement on compositing

Roland Plüss roland at
Tue Jan 7 16:14:20 PST 2014

This problem is nagging me since a long time but recently I could better
nail it down to be a compositing problem on X11. Imagine the following

You have a window with an OpenGL context for 3D rendering.
You create the window with XCreateWindow and an OpenGL infused visual
After creating it you reparent the window into your application

Now the following happens. The created window turns into a child window
as it should at the right place (at (0,0) under it's new parent). If you
render into it using X11 (XFillRectangle for example) everything is fine
and the window is properly cleared from top-left to bottom-right. If you
render to it now though with OpenGL the rendering is at a totally wrong
place on the screen (in my case somewhere near the upper left screen
corner). I tracked the problem down to be a compositing problem (KDE).
When I run this scenario with compositing enabled the OpenGL window is
anywhere but not in the window where it should be. If I disable
compositing the OpenGL rendering is precisely in the window where it
should be.

Has anybody an idea how this could happen?
Is there some ICCCM stuff I have to set to the window to help
compositors to not mess up like this?
Or do I have to XFlush/XSync at problem places?
Some other problem I might have overlooked?
Is reparenting with compositing a huge problem by itself?

It seems X11 with compositing in particular reacts very badly to
reparenting windows after they have been created.

Mit freundlichen Grüssen
Plüss Roland

Leader und Head Programmer
- Game: Epsylon ( )
- Game Engine: Drag[en]gine (
, )
- Normal Map Generator: DENormGen ( )
- Sowie verschiedene Blender Export-Skripts und Game-Tools

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the xorg mailing list