Render window freezes after clicking close button (C++, VTK 9.4)

A lot has changed in the X11 code for VTK between 9.1 and 9.4. But specifically for TerminateApp, the following info might be relevant:

  • In VTK 9.1, a call to renderWindow->Finalize() was added to vtkXRenderWindowInteractor->TerminateApp(). This change was a break with tradition, because in VTK 8 and VTK 9.0, TerminateApp() just sent an event to the X11 loop telling the loop to break, causing the main program to continue from the line after the interactor->Start() call.
  • The VTK 9.1 X11 interactor also differed from the Win32 and macOS ones, since those interactors didn’t call Finalize() in TerminateApp(). They just broke the event loop in TerminateApp(), same as the X11 interactor had done prior to VTK 9.1.

In VTK 9.4, the Finalize() call was removed from the X11 interactor TerminateApp() to restore the X11 behaviour to be more like it had been in VTK 8, and to make it behave the same as the Win32 and macOS interactors.

So that might explain part of the difference you’re seeing with closing the window on X11. But it doesn’t directly explain the X error or the freeze. The most useful thing would be a stack trace to show where the MakeCurrent() that generates the error is.

If you can send a small (but runnable) part of your program that demonstrates the error, someone here can do the debugging. Or you can modify a simple VTK example like the CylinderExample so that it generates the same error.

2 Likes