From ddfe422e32da00649312944b9487960b72f824a1 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Thu, 20 Aug 2020 16:02:12 +0900 Subject: [PATCH] DSZone: fix to use waylandCompositor when it's valid Change-Id: I7b995b018865b17ec9e73736b430a9539227e82b Signed-off-by: Sung-Jin Park --- src/DSZone/DSZone.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index f075601..fe5ab33 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -35,22 +35,23 @@ DSZone::DSZone() : __position{0, 0}, __size{0, 0}, __waylandCompositor(nullptr), - __wm(nullptr) + __wm(nullptr), + __waylandShell(nullptr) { __waylandCompositor = DSWaylandCompositor::getInstance(); if (__waylandCompositor) { __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::__onSurfaceCreated, this, std::placeholders::_1)); __waylandCompositor->registerCallbackSurfaceDestroy(this, std::bind(&DSZone::__onSurfaceDestroy, this, std::placeholders::_1)); - } - __wm = DSWindowManager::getInstance(); - if (__wm) - __wm->registerZone(this); + __wm = DSWindowManager::getInstance(); + if (__wm) + __wm->registerZone(this); - __waylandShell = __waylandCompositor->getShell(); - if (__waylandShell) - __waylandShell->registerCallbackShellSurfaceCreated(this, std::bind(&DSZone::__onShellSurfaceCreated, this, std::placeholders::_1)); + __waylandShell = __waylandCompositor->getShell(); + if (__waylandShell) + __waylandShell->registerCallbackShellSurfaceCreated(this, std::bind(&DSZone::__onShellSurfaceCreated, this, std::placeholders::_1)); + } } DSZone::~DSZone() -- 2.7.4