Problem with VTK 9 and KDE Breeze style, anyone seen this?

Hi folks,

curl -sL https://github.com/Kitware/vtk-examples/raw/gh-pages/Tarballs/Cxx/MinimalQtVTKApp.tar | tar xf -
cd MinimalQtVTKApp/build
cmake ..
make
./MinimalQtVTKApp

When running this with VTK 9.2.6 and Qt 5.15.3 under a KDE 5.24.7 session, where the KDE Breeze Qt style plugin is used for Qt applications, there’s an issue when trying to interact with the render window. When left mouse button is pressed, the entire window is grabbed and moves with the mouse until left mouse button is released. When the mouse button is released I get into a state where the VTK render window is interacted with (camera is spun around), until I make a mouse click.

I’m guessing this is some fighting/weird interaction between the KDE Breeze Qt style’s “feature” (possibly in cooperation with KWin?) with which you can “grab” a window to move it by clicking any “dead” space within a widget. Is KDE Breeze/KWin somehow classifying the space occupied by the VTK render window as “dead”…?

In the same environment, this is not happening with VTK 8.2.0. I discovered it when porting our application to VTK 9 and first thought it was us doing something wrong or our port being incomplete, but then saw I could reproduce it with the VTK example above.

Just thought before I dig deeper into this if anyone seen it before or have a hunch of what’s going on?

The system I was testing on was Kubuntu 22.04.

I forgot to say: If I run the example with another Qt style, e.g. ./MinimalQtVTKApp -style fusion, the issue does not appear, which is how I figured out it’s related to KDE Breeze.

I take it noone has seen it :slight_smile: I’ll dig further into this when time permits.

Is this running under Wayland? I wonder if there isn’t some X event confusion somewhere.

Cc: @dgobbi

Yes, in VTK 9, up to and including 9.2.6, there are some known X11 event bugs.
I don’t know if they’re related to KDE, but they do involve the window manager.

So I suggest trying the master branch, which has the following X11 fixes:
!10077 Fix vtkXOpenGLRenderWindow hang in SetSize
!10240 Put ConfigureNotify event back in stack

It’s under X11.

Yes, in VTK 9, up to and including 9.2.6, there are some known X11 event bugs.
I don’t know if they’re related to KDE, but they do involve the window manager.

So I suggest trying the master branch, which has the following X11 fixes:
!10077 Fix vtkXOpenGLRenderWindow hang in SetSize
!10240 Put ConfigureNotify event back in stack

Thanks, will have a go with master.

I tried with master today as below and the problem seems gone. Thanks @ben.boeckel @dgobbi!

sudo apt install g++-11 ninja libavcodec-dev libavformat-dev libavutil-dev libboost-dev libdouble-conversion-dev libxcursor-dev libeigen3-dev libexpat1-dev libfontconfig-dev libfreetype6-dev libgdal-dev libgl2ps-dev libglew-dev libglvnd-dev libhdf5-dev libjpeg-dev libjsoncpp-dev liblz4-dev liblzma-dev libnetcdf-dev libnetcdf-cxx-legacy-dev libogg-dev libpng-dev libpython3-dev libqt5opengl5-dev libqt5x11extras5-dev libsqlite3-dev libswscale-dev libtheora-dev libtiff-dev libutfcpp-dev libxml2-dev libxt-dev nlohmann-json3-dev qml-module-qtquick2 qtbase5-dev qtdeclarative5-dev qttools5-dev sqlite3 zlib1g-dev
git clone --recurse-submodules git@gitlab.kitware.com:vtk/vtk.git
cd vtk
mkdir build
cd build
cmake -G Ninja \
    -DCMAKE_INSTALL_PREFIX=$HOME/vtk-inst \
    -DCMAKE_INSTALL_RPATH=$HOME/vtk-inst/lib \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DVTK_GROUP_ENABLE_Rendering=YES \
    -DVTK_GROUP_ENABLE_Imaging=YES \
    -DVTK_GROUP_ENABLE_Views=YES \
    -DVTK_GROUP_ENABLE_Qt=YES \
    -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES \
    -DVTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig=YES \
    -DVTK_WRAP_PYTHON=ON \
    -DVTK_BUILD_TESTING=OFF \
    -DVTK_USE_EXTERNAL=YES \
    -DVTK_MODULE_USE_EXTERNAL_VTK_cgns=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_fmt=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_verdict=OFF \
    -DVTK_MODULE_USE_EXTERNAL_VTK_fast_float=OFF \
    -DVTK_CUSTOM_LIBRARY_SUFFIX="" \
    -DCMAKE_BUILD_TYPE=Release \
    ..
cmake --build .
cmake --install .
curl -sL https://github.com/Kitware/vtk-examples/raw/gh-pages/Tarballs/Cxx/MinimalQtVTKApp.tar | tar xf -
cd MinimalQtVTKApp/build
cmake -DVTK_DIR=$HOME/vtk-inst/lib/cmake/vtk-9.2 ..
make
./MinimalQtVTKApp

(Do you know when a 9.2.7 or 9.3.0 with these fixes might be out?)

Ah it was https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10349 that fixed it. Thanks @jschueller!