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

**URL:** https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836
**Category:** Development
**Created:** [June 27, 2023, 7:55pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836 "2023-06-27T19:55:51Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [June 27, 2023, 7:55pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/1 "2023-06-27T19:55:51Z")

</div>

Hi folks,

```auto
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.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [June 27, 2023, 7:57pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/2 "2023-06-27T19:57:28Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [July 19, 2023, 3:52pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/3 "2023-07-19T15:52:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [July 20, 2023, 7:17pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/4 "2023-07-20T19:17:21Z")

</div>

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

Cc: @dgobbi

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [July 20, 2023, 7:35pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/5 "2023-07-20T19:35:34Z")

</div>

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](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10077) Fix vtkXOpenGLRenderWindow hang in SetSize  
[!10240](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10240) Put ConfigureNotify event back in stack

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [July 23, 2023, 1:04pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/6 "2023-07-23T13:04:21Z")

</div>

> [@ben.boeckel](#):
>
> Is this running under Wayland? I wonder if there isn’t some X event confusion somewhere.

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](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10077) Fix vtkXOpenGLRenderWindow hang in SetSize  
> [!10240](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10240) Put ConfigureNotify event back in stack

Thanks, will have a go with master.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [August 1, 2023, 4:44pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/7 "2023-08-01T16:44:38Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [August 1, 2023, 4:45pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/8 "2023-08-01T16:45:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![estan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/estan/32/460_2.png) [@estan](https://discourse.vtk.org/u/estan)
#### Post date: [August 2, 2023, 5:49pm UTC](https://discourse.vtk.org/t/problem-with-vtk-9-and-kde-breeze-style-anyone-seen-this/11836/9 "2023-08-02T17:49:45Z")

</div>

> [@estan](#):
>
> I tried with master today as below and the problem seems gone.

Ah it was [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/10349](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10349) that fixed it. Thanks @jschueller!
