VTK using on wayland

@jaswantp No wonder!!

I did a simple test.

  1. Set Ubuntu 22.04 to use wayland

  2. downloaded the VTK 9.1.0 source code and built it with the VTK_USE_X=OFF and VTK_OPENGL_HAS_EGL=ON options ( I believe the apt install vtk9 package is built with VTK_USE_X=ON and VTK_OPENGL_HAS_EGL=OFF options )

  3. Built a modified version of the Cylinder Example, adding the following module initialization lines to the code:

    VTK_MODULE_INIT(vtkInteractionStyle);
    VTK_MODULE_INIT(vtkRenderingContextOpenGL2);
    VTK_MODULE_INIT(vtkRenderingFreeType);
    VTK_MODULE_INIT(vtkRenderingOpenGL2);
    

    The example was compiled using the following command:

    g++ Cylinder.cxx -o Cylinder -I<path-to-my-vtk-header> -L<path-to-my-vtk-library> -Wl,-rpath-link <path-to-my-vtk-library> -Wl,-rpath <path-to-my-vtk-library> -lvtkCommonColor-9.1 -lvtkCommonCore-9.1 -lvtkFiltersSources-9.1 -lvtkInteractionStyle-9.1 -lvtkRenderingContextOpenGL2-9.1 -lvtkRenderingCore-9.1 -lvtkRenderingFreeType-9.1 -lvtkRenderingOpenGL2-9.1 -lvtkCommonExecutionModel-9.1
    
  4. Finally, ran the Cylinder program, but it exited immediately without stopping at renderWindowInteractor->Start() and showing an interactive window. :joy:

The above is just the testing scenario. However, my actual environment is a Wayland-based system running on an AM62xx SoC ( which might not be recognized as Android ). What workarounds can I use to make this work?