diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2017-04-06 10:57:37 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-05-18 09:01:03 +0000 |
commit | 458dfb4c65dd959115416a5bc9d6dfc5e4936bd6 (patch) | |
tree | 4d08e01fc30f042a52f2d9ecbd47c41d22be37fa /src/compositor/extensions/qwaylandxdgshellv6integration.cpp | |
parent | 2dd9db479cc0cedc6401e9283d2ad7c3b432a045 (diff) |
Compositor: Automatically create ShellSurfaceItems for popups
Change-Id: I5e6b0147c4f1bb73ff3a8f5512d21884f962a89a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/extensions/qwaylandxdgshellv6integration.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshellv6integration.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellv6integration.cpp b/src/compositor/extensions/qwaylandxdgshellv6integration.cpp index 17ee10db7..68230937f 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6integration.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv6integration.cpp @@ -44,6 +44,12 @@ QT_BEGIN_NAMESPACE namespace QtWayland { +static void handlePopupCreated(QWaylandQuickShellSurfaceItem *parentItem, QWaylandXdgPopupV6 *popup) +{ + if (parentItem->shellSurface() == popup->parentXdgSurface()) + QWaylandQuickShellSurfaceItemPrivate::get(parentItem)->maybeCreateAutoPopup(popup->xdgSurface()); +} + XdgToplevelV6Integration::XdgToplevelV6Integration(QWaylandQuickShellSurfaceItem *item) : QWaylandQuickShellIntegration(item) , m_item(item) @@ -54,12 +60,16 @@ XdgToplevelV6Integration::XdgToplevelV6Integration(QWaylandQuickShellSurfaceItem Q_ASSERT(m_toplevel); m_item->setSurface(m_xdgSurface->surface()); + connect(m_toplevel, &QWaylandXdgToplevelV6::startMove, this, &XdgToplevelV6Integration::handleStartMove); connect(m_toplevel, &QWaylandXdgToplevelV6::startResize, this, &XdgToplevelV6Integration::handleStartResize); connect(m_toplevel, &QWaylandXdgToplevelV6::setMaximized, this, &XdgToplevelV6Integration::handleSetMaximized); connect(m_toplevel, &QWaylandXdgToplevelV6::unsetMaximized, this, &XdgToplevelV6Integration::handleUnsetMaximized); connect(m_toplevel, &QWaylandXdgToplevelV6::maximizedChanged, this, &XdgToplevelV6Integration::handleMaximizedChanged); connect(m_toplevel, &QWaylandXdgToplevelV6::activatedChanged, this, &XdgToplevelV6Integration::handleActivatedChanged); + connect(m_xdgSurface->shell(), &QWaylandXdgShellV6::popupCreated, this, [item](QWaylandXdgPopupV6 *popup, QWaylandXdgSurfaceV6 *){ + handlePopupCreated(item, popup); + }); connect(m_xdgSurface->surface(), &QWaylandSurface::sizeChanged, this, &XdgToplevelV6Integration::handleSurfaceSizeChanged); } @@ -181,6 +191,9 @@ XdgPopupV6Integration::XdgPopupV6Integration(QWaylandQuickShellSurfaceItem *item handleGeometryChanged(); connect(m_popup, &QWaylandXdgPopupV6::configuredGeometryChanged, this, &XdgPopupV6Integration::handleGeometryChanged); + connect(m_xdgSurface->shell(), &QWaylandXdgShellV6::popupCreated, this, [item](QWaylandXdgPopupV6 *popup, QWaylandXdgSurfaceV6 *){ + handlePopupCreated(item, popup); + }); } void XdgPopupV6Integration::handleGeometryChanged() |