Fix vtkXOpenGLRenderWindow hang in SetSize
Previously, after XResizeWindow()
was called, XIfEvent()
was used to wait for the ConfigureNotify
that indicated that the resize had occurred. Unfortunately, this would sometimes cause the program to hang indefinitely. This was noticed in particular with vtkQtRenderWindowInteractor.py
, possibly due to race conditions between Qt and VTK.
Hypothetically the hang could occur simply due to the window manager. I found this interesting text from the source code of Tk 8.6, in its WaitForConfigureNotify function:
* One more tricky detail about this function. In some cases the window
* manager will decide to ignore a configure request (e.g. because it
* thinks the window is already in the right place). To avoid hanging in
* this situation, only wait for a few seconds, then give up.
Following this advice, the new code has a simple delay loop with a timeout to wait for the resize.
Backport: paraview/release
Backport: release