QX11EmbedContainer bug with multiple desktops

I think there is a bug with using QX11EmbedContainer with multiple desktops.

I am running on redhat 5.4
I have a simple test app that you can enter the window ID click a button and then the Window will be embedded in the application, there is also a button to unembed the window.

If I do the following the window does not get embedded correctly:

Desktop1: Contains the X11 Window I want to embed.
Desktop2: Contains the QT test application to embed the X11 Window.

While on Desktop 2 I enter in the window ID of the X11 window on desktop 1 and click the embed button. The window is embedded and everything looks fine. If I then switch back to Desktop 1 the Frame of the window that was embedded is still there. I can resize it but the contents of the window is anything that you drag over the window with the mouse. It's exactly like when an application crashes on Windows and you can drag the application all over the screen and fill up the screen with cascasding copies it self. If I go back to Desktop 2 and look at the test app the window is no longer displayed. If I hit the unembed button and go back to Desktop 1 the empty frame will still be there but the window that was embedded is now stuck to the top left of the desktop. It almost seems like the window's parent was remapped to the top level X11 node.

Note that everything works fine if everything is running on the same desktop. It's only a problem with switching desktops.

Does anyone know how to prevent this from happening? Or if there is a fix for this?