From e80ecff496ef8f7d6a6b66b4d2f1a28f49d95719 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 11 Aug 2020 15:45:20 +0900 Subject: [PATCH] DSZone: add ShellSurfaceCreated callback Change-Id: Iac4fb4ef87121c059364c467623ff98e46e9ad56 --- src/DSZone/DSZone.cpp | 13 +++++++++++++ src/DSZone/DSZone.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index 83f033c..6d6f262 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -17,6 +17,8 @@ DSZone::DSZone() __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::__onSurfaceCreated, this, std::placeholders::_1)); __waylandShell = __waylandCompositor->getShell(); + if (__waylandShell) + __waylandShell->registerCallbackShellSurfaceCreated(this, std::bind(&DSZone::__onShellSurfaceCreated, this, std::placeholders::_1)); } DSZone::~DSZone() @@ -80,6 +82,17 @@ void DSZone::__onSurfaceCreated(std::shared_ptr waylandSurface std::shared_ptr shell = __createWindowShell(window); } +void DSZone::__onShellSurfaceCreated(IDSWaylandShellSurface *waylandShellSurface) +{ + DSLOG_DBG("DSZone", "waylandShellSurface:(pure:%p)", waylandShellSurface); + + if (waylandShellSurface) + { + struct ::wl_resource *wlSurface = waylandShellSurface->getWlSurface(); + DSLOG_DBG("DSZone", "get wl_surface:%p", wlSurface); + } +} + // for Test void DSZone::callCallbackWindowShellCreated() { diff --git a/src/DSZone/DSZone.h b/src/DSZone/DSZone.h index f2adf51..44591da 100644 --- a/src/DSZone/DSZone.h +++ b/src/DSZone/DSZone.h @@ -13,6 +13,7 @@ class DSWaylandCompositor; class DSWaylandSurface; class DSWaylandZxdgSurfaceV6; class IDSWaylandShell; +class IDSWaylandShellSurface; class DSZone : public DSObject { @@ -37,6 +38,7 @@ public: private: void __onSurfaceCreated(std::shared_ptr waylandSurface); + void __onShellSurfaceCreated(IDSWaylandShellSurface *waylandShellSurface); std::shared_ptr __createWindow(std::shared_ptr waylandSurface); std::shared_ptr __createWindowShell(std::shared_ptr window); std::shared_ptr __findWindow(DSWaylandSurface *dswlSurface); -- 2.7.4