From 3486ed8d722fd40838c74607b222f698ae82f787 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Sat, 22 Aug 2020 17:11:24 +0900 Subject: [PATCH] DSWindowManager: add API for setting parent window Change-Id: I87e6d1550ce89eede32ec2b2a421332126469e9d --- src/DSWindowManager/DSWindowManager.cpp | 17 +++++++++++++++++ src/DSWindowManager/DSWindowManager.h | 1 + src/DSWindowManager/DSWindowManagerPrivate.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/DSWindowManager/DSWindowManager.cpp b/src/DSWindowManager/DSWindowManager.cpp index ecb0420..3fc3e44 100644 --- a/src/DSWindowManager/DSWindowManager.cpp +++ b/src/DSWindowManager/DSWindowManager.cpp @@ -201,6 +201,17 @@ DSZone *DSWindowManagerPrivate::getZone(DSWaylandSurface *surface) return __getZone(surface); } +bool DSWindowManagerPrivate::setWindowParent(DSWaylandSurface *dswlSurface, DSWaylandSurface *dswlParentSurface) +{ + // find dsSurface's window + DSZone *zone = __getZone(dswlSurface); + if (!zone) return false; + + DSZone *pZone = __getZone(dswlParentSurface); + if (zone != pZone) return false; + + return zone->setWindowParent(dswlSurface, dswlParentSurface); +} void DSWindowManagerPrivate::setWindowTitle(DSWaylandSurface *dsSurface, const std::string &title) { @@ -421,6 +432,12 @@ DSZone *DSWindowManager::getZone(DSWaylandSurface *surface) return priv->getZone(surface); } +bool DSWindowManager::setWindowParent(DSWaylandSurface *dswlSurface, DSWaylandSurface *dswlParentSurface) +{ + DS_GET_PRIV(DSWindowManager); + return priv->setWindowParent(dswlSurface, dswlParentSurface); +} + void DSWindowManager::setWindowTitle(DSWaylandSurface *dsSurface, const std::string &title) { DS_GET_PRIV(DSWindowManager); diff --git a/src/DSWindowManager/DSWindowManager.h b/src/DSWindowManager/DSWindowManager.h index e7a135b..c11a495 100644 --- a/src/DSWindowManager/DSWindowManager.h +++ b/src/DSWindowManager/DSWindowManager.h @@ -55,6 +55,7 @@ public: void unregisterSurface(DSZone *zone, DSWaylandSurface *surface); DSZone *getZone(DSWaylandSurface *surface); + bool setWindowParent(DSWaylandSurface *dswlSurface, DSWaylandSurface *dswlParentSurface); void setWindowTitle(DSWaylandSurface *dsSurface, const std::string &title); void setWindowType(DSWaylandSurface *dsSurface, int type); void setWindowGeometry(DSWaylandSurface *dsSurface, int x, int y, unsigned int w, unsigned h); diff --git a/src/DSWindowManager/DSWindowManagerPrivate.h b/src/DSWindowManager/DSWindowManagerPrivate.h index be3610c..28f6ec2 100644 --- a/src/DSWindowManager/DSWindowManagerPrivate.h +++ b/src/DSWindowManager/DSWindowManagerPrivate.h @@ -50,6 +50,7 @@ public: void unregisterSurface(DSZone *zone, DSWaylandSurface *surface); DSZone *getZone(DSWaylandSurface *surface); + bool setWindowParent(DSWaylandSurface *dswlSurface, DSWaylandSurface *dswlParentSurface); void setWindowTitle(DSWaylandSurface *dsSurface, const std::string &title); void setWindowType(DSWaylandSurface *dsSurface, int type); void setWindowGeometry(DSWaylandSurface *dsSurface, int x, int y, unsigned int w, unsigned h); -- 2.7.4