From fef4a14554b1d4ff9c35b938ad02ff8e2378ee7c Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Fri, 21 Aug 2020 14:22:34 +0900 Subject: [PATCH] DSWindow: make registerCallbackWindowDestroyed method Change-Id: I5c2ef80a43b83956808bc9142221dfb949ffa992 --- src/DSWindow/DSWindow.cpp | 7 ++++++- src/DSWindow/DSWindow.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/DSWindow/DSWindow.cpp b/src/DSWindow/DSWindow.cpp index 8c10913..2b31ec1 100644 --- a/src/DSWindow/DSWindow.cpp +++ b/src/DSWindow/DSWindow.cpp @@ -211,7 +211,7 @@ DSWindow::DSWindow(std::shared_ptr waylandSurface) DSWindow::~DSWindow() { - + this->__windowDestroySignal.emit(nullptr); } bool DSWindow::create(std::shared_ptr waylandSurface) @@ -397,4 +397,9 @@ void DSWindow::registerCallbackBufferChanged(DSObject *slot, std::function func) +{ + __windowDestroySignal.connect(slot, func); +} + } // namespace display_server diff --git a/src/DSWindow/DSWindow.h b/src/DSWindow/DSWindow.h index 10fb3b8..eeb4a04 100644 --- a/src/DSWindow/DSWindow.h +++ b/src/DSWindow/DSWindow.h @@ -80,6 +80,7 @@ public: void registerCallbackSizeChanged(DSObject *slot, std::function)> func); void registerCallbackBufferChanged(DSObject *slot, std::function)> func); + void registerCallbackWindowDestroyed(DSObject *slot, std::function func); protected: //virtual bool _onFocus(void); @@ -89,6 +90,7 @@ private: // signals DSSignal> __sizeChangedSignal; DSSignal> __bufferChangedSignal; + DSSignal __windowDestroySignal; }; } -- 2.7.4