summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r--src/client/qwaylandwindow.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index a54979a2f..ed7b656d9 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -156,7 +156,8 @@ void QWaylandWindow::initWindow()
mShellSurface->updateTransientParent(window()->transientParent());
}
} else {
- mShellSurface->setTopLevel();
+ if (window()->type() != Qt::ToolTip)
+ mShellSurface->setTopLevel();
}
}
@@ -266,17 +267,18 @@ void QWaylandWindow::setGeometry(const QRect &rect)
void QWaylandWindow::setVisible(bool visible)
{
if (visible) {
- if (window()->type() == Qt::Popup) {
- QWaylandWindow *parent = transientParent();
- if (!parent) {
- // Try with the current focus window. It should be the right one and anyway
- // better than having no parent at all.
- parent = mDisplay->lastInputWindow();
- }
- if (parent) {
- QWaylandWlShellSurface *wlshellSurface = qobject_cast<QWaylandWlShellSurface*>(mShellSurface);
- if (wlshellSurface)
- wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial());
+ if (mShellSurface) {
+ if (window()->type() == Qt::Popup) {
+ QWaylandWindow *parent = transientParent();
+ if (parent) {
+ QWaylandWlShellSurface *wlshellSurface = qobject_cast<QWaylandWlShellSurface*>(mShellSurface);
+ if (wlshellSurface)
+ wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial());
+ }
+ } else if (window()->type() == Qt::ToolTip) {
+ if (QWaylandWindow *parent = transientParent()) {
+ mShellSurface->updateTransientParent(parent->window());
+ }
}
}
@@ -643,7 +645,9 @@ QWaylandWindow *QWaylandWindow::transientParent() const
// events.
return static_cast<QWaylandWindow *>(topLevelWindow(window()->transientParent())->handle());
}
- return 0;
+ // Try with the current focus window. It should be the right one and anyway
+ // better than having no parent at all.
+ return mDisplay->lastInputWindow();
}
void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e)