DSZone: fix to use waylandCompositor when it's valid 74/241874/1
authorSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 07:02:12 +0000 (16:02 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:12:32 +0000 (19:12 +0900)
Change-Id: I7b995b018865b17ec9e73736b430a9539227e82b
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSZone/DSZone.cpp

index f075601..fe5ab33 100644 (file)
@@ -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()