vtk version : 9.2.2
python version : 3.9.13 (main, Aug 25 2022, 23:26:10) [GCC 11.2.0]
python interpreter: /home/musy/soft/anaconda3/bin/python
system : Linux 5.4.0-131-generic posix x86_64
I can also confirm that this regression did not exist in VTK 9.1.0, but it does exist in the VTK master branch.
Here’s a partial stack trace from where the vtkXOpenGLRenderWindow is attempting to create a new X Window to replace the one that had previously been destroyed:
The test program doesn’t crash if I revert 7ce7fd78f6. I think the Finalize() method will need to be fixed, which is strange because it already clears the DisplayId like it should. Maybe there are other variables that it also needs to clear so that CreateAWindow() can safely be called. @mwestphal
Edit: I think I see the problem. The DisplayId is cleared in the interactor, but the DisplayId of the window is not cleared (dangling pointer).
The vtkXRenderWindowInteractor::Finalize() method apparently puts the interactor into an unusable state. This should be easy to fix in the VTK codebase.
In the meantime, I think that your only option is to create a new interactor: