__waylandCompositor(nullptr)
{
__waylandCompositor = DSWaylandCompositor::getInstance();
- __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::onSurfaceCreated, this, std::placeholders::_1));
+ __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::__onSurfaceCreated, this, std::placeholders::_1));
}
DSZone::~DSZone()
__windowCreatedSignal.emit(nullptr);
}
-void DSZone::onSurfaceCreated(std::shared_ptr<DSWaylandSurface> waylandSurface)
+void DSZone::__onSurfaceCreated(std::shared_ptr<DSWaylandSurface> waylandSurface)
{
+ DSLOG_DBG("DSZone", "waylandSurface:(shared:%p, pure:%p)", waylandSurface, waylandSurface.get());
+
// create DSWindow
- std::shared_ptr<DSWindow> window = std::make_shared<DSWindow>(waylandSurface);
- __windowList.push_front(window);
+ std::shared_ptr<DSWindow> window = __createWindow(waylandSurface);
- // emit a signal of the surface committed
- __windowCreatedSignal.emit(window);
+ // create DSWindowShell
+ std::shared_ptr<DSWindowShell> shell = __createWindowShell(window);
}
// for Test
return nullptr;
}
-void DSZone::__onShellSurfaceCreated(std::shared_ptr<DSWaylandZxdgSurfaceV6> shellSurface)
+std::shared_ptr<DSWindow> DSZone::__createWindow(std::shared_ptr<DSWaylandSurface> waylandSurface)
{
- struct ::wl_resource *surface = shellSurface->getWlSurface();
- DSWaylandSurface *dswlSurface = DSWaylandSurface::fromWlResource(surface);
+ std::shared_ptr<DSWindow> window = std::make_shared<DSWindow>(waylandSurface);
+ __windowList.push_front(window);
- std::shared_ptr<DSWindow> window = __findWindow(dswlSurface);
+ // emit a signal of the surface committed
+ __windowCreatedSignal.emit(window);
+
+ return window;
+}
+std::shared_ptr<DSWindowShell> DSZone::__createWindowShell(std::shared_ptr<DSWindow> window)
+{
std::shared_ptr<DSWindowShell> shell = std::make_shared<DSWindowShell>(window.get());
__windowShellList.push_front(shell);
// emit a signal of the shell created
__windowShellCreatedSignal.emit(shell);
+
+ return shell;
}
+
} // namespace display_server
std::list<std::shared_ptr<DSWindow>> getWindowList();
private:
- void onSurfaceCreated(std::shared_ptr<DSWaylandSurface> waylandSurface);
- void __onShellSurfaceCreated(std::shared_ptr<DSWaylandZxdgSurfaceV6> shellSurface);
+ void __onSurfaceCreated(std::shared_ptr<DSWaylandSurface> waylandSurface);
+ std::shared_ptr<DSWindow> __createWindow(std::shared_ptr<DSWaylandSurface> waylandSurface);
+ std::shared_ptr<DSWindowShell> __createWindowShell(std::shared_ptr<DSWindow> window);
std::shared_ptr<DSWindow> __findWindow(DSWaylandSurface *dswlSurface);
stPosition __position;