From 4b978bb40379732baa705fd9d3aaaaab11087a23 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 7 Aug 2020 21:43:59 +0300 Subject: [PATCH] wayland: Switch to generic xdg_popup parent property --- xdgshellclient.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index cc61aa8b8..d10706aea 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -1844,15 +1844,6 @@ XdgPopupClient::XdgPopupClient(XdgPopupInterface *shellSurface) this, &XdgPopupClient::initialize); connect(shellSurface, &XdgPopupInterface::destroyed, this, &XdgPopupClient::destroyClient); - - // The xdg-shell spec states that the parent xdg-surface may be null if it is specified - // via "some other protocol," but we don't support any such protocol yet. Notice that the - // xdg-foreign protocol is only for toplevel surfaces. - - XdgSurfaceInterface *parentShellSurface = shellSurface->parentXdgSurface(); - AbstractClient *parentClient = waylandServer()->findClient(parentShellSurface->surface()); - parentClient->addTransient(this); - setTransientFor(parentClient); } XdgPopupClient::~XdgPopupClient() @@ -2131,6 +2122,10 @@ void XdgPopupClient::handleGrabRequested(SeatInterface *seat, quint32 serial) void XdgPopupClient::initialize() { + AbstractClient *parentClient = waylandServer()->findClient(m_shellSurface->parentSurface()); + parentClient->addTransient(this); + setTransientFor(parentClient); + const QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); placeIn(area);