window->handleMouse(inputDevice,
time,
inputDevice->mSurfacePos,
- inputDevice->mSurfacePos,
+ inputDevice->mGlobalPos,
inputDevice->mButtons,
Qt::NoModifier);
}
window->handleMouse(inputDevice,
time,
inputDevice->mSurfacePos,
- inputDevice->mSurfacePos,
+ inputDevice->mGlobalPos,
inputDevice->mButtons,
Qt::NoModifier);
}
Q_UNUSED(surface);
QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data;
-
inputDevice->mKeyboardFocus = NULL;
inputDevice->mQDisplay->setLastKeyboardFocusInputDevice(0);
QWindowSystemInterface::handleWindowActivated(0);
if (!parent_wayland_window || !parent_wayland_window->shellSurface())
return;
- QPoint transientPos = m_window->geometry().topLeft();
+ // set_transient expects a position relative to the parent
+ QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
+ QWindow *parentWin = m_window->window()->transientParent();
+ transientPos -= parentWin->geometry().topLeft();
if (parent_wayland_window->decoration()) {
transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left());
transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top());
return;
}
- QPointF localTranslated = local;
QMargins marg = frameMargins();
QRect windowRect(0 + marg.left(),
0 + marg.top(),
geometry().size().width() - marg.right(),
geometry().size().height() - marg.bottom());
if (windowRect.contains(local.toPoint()) || mMousePressedInContentArea != Qt::NoButton) {
+ QPointF localTranslated = local;
+ QPointF globalTranslated = global;
localTranslated.setX(localTranslated.x() - marg.left());
localTranslated.setY(localTranslated.y() - marg.top());
+ globalTranslated.setX(localTranslated.x() - marg.left());
+ globalTranslated.setY(localTranslated.y() - marg.top());
if (!mMouseEventsInContentArea) {
mWindowDecoration->restoreMouseCursor();
QWindowSystemInterface::handleEnterEvent(window());
}
- QWindowSystemInterface::handleMouseEvent(window(),timestamp,localTranslated,global,b,mods);
+ QWindowSystemInterface::handleMouseEvent(window(), timestamp, localTranslated, globalTranslated, b, mods);
mMouseEventsInContentArea = true;
mMousePressedInContentArea = b;
} else {