From 5030f47e19168d1e03f8c33a95aa02b1f9f55741 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 24 Aug 2020 08:46:56 +0900 Subject: [PATCH] DSWaylandZxdgToplevel: implement set_parent Change-Id: If4e310ceea19cae12bad463d09913d87b85a7086 --- src/DSWaylandServer/DSWaylandZxdgShellV6.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp b/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp index 1e38eae..f72a1e7 100644 --- a/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp +++ b/src/DSWaylandServer/DSWaylandZxdgShellV6.cpp @@ -544,9 +544,24 @@ void DSWaylandZxdgToplevelV6Private::zxdg_toplevel_v6_destroy_resource(zxdg_topl void DSWaylandZxdgToplevelV6Private::zxdg_toplevel_v6_destroy(zxdg_toplevel_v6::Resource *resource) { } + void DSWaylandZxdgToplevelV6Private::zxdg_toplevel_v6_set_parent(zxdg_toplevel_v6::Resource *resource, struct ::wl_resource *parent) { + DSLOG_DBG("XDG_TopLevel", "Set Parent (parent:%p)", parent); + + DSWaylandSurface *surface = __zxdgSurface->getSurface(); + if (!surface) return; + + DSWaylandSurface *parentSurface = DSWaylandSurface::fromWlResource(parent); + + DSWindowManager *wm = DSWindowManager::getInstance(); + if (wm) + { + wm->setWindowParent(surface, parentSurface); + DSWindowManager::releaseInstance(); + } } + void DSWaylandZxdgToplevelV6Private::zxdg_toplevel_v6_set_title(zxdg_toplevel_v6::Resource *resource, const std::string &title) { __zxdgSurface->setWindowTitle(title); -- 2.7.4