linuxqtkde-plasmaqtopengl

Qt window moves even when intercepting mouse events


I have a Qt OpenGL (with qt 5.5) Application in which you can click to drag objects in a 3D scene.

This is implemented by having a subclass of QOpenGLWidget which overrides mousePressEvent, mouseReleaseEvent and mouseMoveEvent.

However, when I drag an object, I can move it for one frame before the window starts activating the window move mode, and my mouse movements actually start moving the whole window, as if I was dragging the title bar.

I suspect there is a conflict between the application and my window manager (kwin 5.4.3), but I don't know where to look at to debug this issue and whether it's my application's fault or if I have to fix my window manager.


Solution

  • You may need to call the accept() method of the event you are handling.