diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2016-06-20 20:30:09 +0200 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> | 2016-06-23 16:07:19 +0000 |
commit | 9c61835aaef49848d5aa376ec561fbaeff1b5df5 (patch) | |
tree | 30b876daeec77892b398c25939dac52aceb8572d | |
parent | db229d2502ae92bb9b483d83d212b2eaa29da622 (diff) |
Compositor: fix wl_shell popups on multi-output
Find the parent item on the same output.
Change-Id: I9c978f956949d134015cbfbf692a6561d882264c
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r-- | src/compositor/extensions/qwaylandwlshellintegration.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp index a1ef5f32a..fe878e795 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration.cpp +++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp @@ -81,7 +81,18 @@ void WlShellIntegration::handleSetPopup(QWaylandInputDevice *inputDevice, QWayla { Q_UNUSED(inputDevice); - QWaylandQuickShellSurfaceItem* parentItem = qobject_cast<QWaylandQuickShellSurfaceItem*>(parent->views().first()->renderObject()); + // Find the parent item on the same output + QWaylandQuickShellSurfaceItem *parentItem = nullptr; + Q_FOREACH (QWaylandView *view, parent->views()) { + if (view->output() == m_item->view()->output()) { + QWaylandQuickShellSurfaceItem *item = qobject_cast<QWaylandQuickShellSurfaceItem*>(view->renderObject()); + if (item) { + parentItem = item; + break; + } + } + } + if (parentItem) { // Clear all the transforms for this ShellSurfaceItem. They are not // applicable when the item becomes a child to a surface that has its |