Issue occurring with successive calls to QX11EmbedContainer::embedClient()
Hi All,
QT Version: 4.7.1
Platform: Linux Kubuntu 14
Compiler: c++11
After a long period of research on the web and forums, I successfully managed to use QX11EmbedContainer in order to embed a external application into a QT Widget.
The QT application holds a push button that is pressed by the user.
This is the general implemenation. How i get the window id is not of importance:
Code:
Demo::Demo() {
layout->addWidget(container);
}
WId Demo::getWinID() {
//Implementation
}
void Demo::runExternalApp() {
//Implementation
}
void Demo::on_runAppButton_clicked() {
runExternalApp()
container->embedClient(getWinID());
}
After pressing the button, and the call to embedClient() the external application is successfully embedded exactly where I want it to, and its also functioning properly.
My problem starts when I try to close the external application regularly (from within my QT application) and then re-press the push button that embeds the external application (on_runAppButton_clicked()).
The external application is terminated properly when regularly exiting from it.
After pressing the push button again: the application is re-executed properly and embedded, but this time, it is embedded with a offset from the bottom of the layout that holds the container widget (QX11EmbedContainer widget).
Bare in mind the QT application keeps running throughout this process without terminating - The layout, container widget and parent widget aren't destroyed or anything like that.
Your help will be very helpful,
Thanks
Re: Issue occurring with successive calls to QX11EmbedContainer::embedClient()
Seems like there should be a call to discardClient() when you close the external application. My guess is that the container is still reserving space for the client because it may not know that the winID has become invalid.