From b1f017ed5a12ab2dd305133c8c7f28deb3218a69 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Sat, 8 Sep 2018 20:59:51 +0900 Subject: Add callback function when surface dead Signed-off-by: Kazumasa Mitsunari --- src/window_manager.cpp | 3 +++ src/wm_layer_control.cpp | 2 +- src/wm_layer_control.hpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/window_manager.cpp b/src/window_manager.cpp index acf3b76..6818438 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -172,6 +172,9 @@ int WindowManager::init() lmcb.surfaceCreated = [&](unsigned pid, unsigned surface){ this->surface_created(surface); }; + lmcb.surfaceDestroyed = [&](unsigned surface){ + this->surface_removed(surface); + }; this->lc->init(lmcb); this->loadOldRoleDb(); diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp index 4519922..813e4ab 100644 --- a/src/wm_layer_control.cpp +++ b/src/wm_layer_control.cpp @@ -408,7 +408,7 @@ void LayerControl::dispatchCreateEvent(ilmObjectType object, unsigned id, bool c } else { - // this->cb->surfaceDestroyed(id); + this->cb.surfaceDestroyed(id); } } if (ILM_LAYER == object) diff --git a/src/wm_layer_control.hpp b/src/wm_layer_control.hpp index 503ec3b..f637d8d 100644 --- a/src/wm_layer_control.hpp +++ b/src/wm_layer_control.hpp @@ -45,6 +45,7 @@ class LayerControlCallbacks { // callback functions std::function surfaceCreated; + std::function surfaceDestroyed; /* std::function surfaceDestroyed; std::function layerCreated; std::function layerDestroyed; */ -- cgit 1.2.3-korg