I am currently writing a frontend application for snes9x (a command line snes emulator) with pyqt3/pykde. I first wanted to write it with pyqt4 but because QX11EmbedContainer is missing I switched to pykde and its QXEmbed class.
But that's not the problem. It is that the application always reacts differently each time I start snes9x (loading a rom with it : a snes game file) with a QProcess and then try to embed it. Sometimes it isn't embeded at all and stay in a X window, sometimes it seems to be embeded (sound works but nothing more is displayed in the pykde window) and minimizing the pykde application make snes9x appear in an external X window, and sometimes it simply works.
The two questions are why and what can I do to improve my code and make it stable?

Thank you in advance, AdrienV

PS: my script is joined to this email.