summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwlshellsurface.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-04-23 21:00:59 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-07-04 07:31:17 +0000
commitcc694272c201e57e8bffdb770059e51ac998c5f9 (patch)
treeeed86233a9764dc8cdcd19d11c5b26bcec02b7e8 /src/client/qwaylandwlshellsurface.cpp
parent05ea6b992f32443df27e38bdc8b21cf970755b57 (diff)
Fix tooltips without a transient parent
QToolTip has the same problems as QMenu, that is you can create one without a parent and with a global position. Use the same trick and use the window that last received an input event as the parent. Change-Id: I093c8da0d54110903f35670b01dea6fa96abecf4 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/client/qwaylandwlshellsurface.cpp')
-rw-r--r--src/client/qwaylandwlshellsurface.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp
index 8888dbf4d..f7bdc2c99 100644
--- a/src/client/qwaylandwlshellsurface.cpp
+++ b/src/client/qwaylandwlshellsurface.cpp
@@ -159,8 +159,7 @@ void QWaylandWlShellSurface::updateTransientParent(QWindow *parent)
// 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();
+ transientPos -= parent->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());