[aurorae] Fix the position passed in the QMouseEvent for processMousePressEvent

The position passed to core didn't take care of padding and that position
passed to decorationPos caused completely broken resize/moving behavior.
E.g. resize was started where it should have been moving, or jumping of
position when starting moving.

REVIEW: 118803
This commit is contained in:
Martin Gräßlin 2014-06-17 20:26:37 +02:00
parent bc236f3a4d
commit 3a4bba7542

View file

@ -486,7 +486,7 @@ void AuroraeClient::titlePressed(int button, int buttons)
void AuroraeClient::titlePressed(Qt::MouseButton button, Qt::MouseButtons buttons) void AuroraeClient::titlePressed(Qt::MouseButton button, Qt::MouseButtons buttons)
{ {
const QPoint cursor = QCursor::pos(); const QPoint cursor = QCursor::pos();
QMouseEvent *event = new QMouseEvent(QEvent::MouseButtonPress, m_view->mapFromGlobal(cursor), QMouseEvent *event = new QMouseEvent(QEvent::MouseButtonPress, cursor - geometry().topLeft() + (m_padding ? QPoint(m_padding->left(), m_padding->top()) : QPoint(0, 0)),
cursor, button, buttons, Qt::NoModifier); cursor, button, buttons, Qt::NoModifier);
processMousePressEvent(event); processMousePressEvent(event);
delete event; delete event;