I’m using Qt 4.8.3 on X11.
I need to know when the user ends with dragging a window around the screen, this in order to read the final position and eventually start an animation to adjust the window position to an “allowed” one.
I noticed that the QWidget::moveEvent
is called for each small movement, but this is very unconvenient because I must perform position checking (and eventually start the animation) only when the user releases the mouse button and the movement is completely finished.
This is the real problem: it seems that there is no way to detect the mouse release event (or to get the mouse buttons status) when the user clicks on the titlebar, since it is controlled by the OS and not by Qt.
I tried also with the QWidget::x11event(XEvent* e)
… but the events are collected only inside the window, not the title bar, as well.
Does someone know a way to achieve this?
I suspect that I will have to reimplement the titlebar myself… too bad…