Regression on Multiple Render Windows with VTK9
Hi all,
A customer reported the following problem with VTK9 and multiple renderWindows on Linux (Arch and Debian).
Compiling and executing the example : https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/MultipleRenderWindows/ in VTK8 (8.2.0) , VTK9 (release v9.0.0) gives very different results :
VTK8, all renderWindows start successfully and respond to events:
VTK9 (release 9.0.0), only the last renderWindow responds to events, the only way to exit the program is to close the last renderWindow.
VTK8 and VTK9 have different behaviour when starting several renderWindows in the same thread :
VTK8 : All renderWindows respond to events.
VTK9 : Only the started renderWindow responds to events.
To be noted that the behaviour in VTK9 on Windows is the same as the one in VTK8.
We confirmed with @ken-martin that this is actually a bug.
It seems that the following could be done :
Make an interactor store a pointer to itself in an Xwindow when initialized. Then when processing events, that value can be retrieved and used to forward events for that window to the correct interactor for processing.
So in initialize :
XInternAtom(display, "VTK_INTERACTOR", False);
XChangeProperty(...)
Then in the code to process events something like :
XPeekEvent
use the window of the event to XGetWindowProperty
if the VTK_INTERACTOR property is there
{
XNextEvent
cast the property to a vtkXRenderWindowInteractor named iren
iren->DispatchEvent(event);
}