summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-08-28 10:47:01 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-08-28 12:24:42 +0200
commit6169341cbbeebdd6deed7c012b2ba79e1f6d95ff (patch)
treedd3dd688eabf504913df465bb1a384521fcafda4 /src/client/qwaylandwindow.cpp
parent87499ddd653fb20796c2dd2eabac37b45240ef1c (diff)
parent3dc9cfdbd2771c28c770d432b99e571db43fe599 (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6v5.6.0-alpha1
Conflicts: src/client/qwaylandwindow.cpp Change-Id: I80ead87f3e1f36299b1bf9cc9c7db6cd48c0e86f
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)