From dd6bcaad18c8e61321b2881f08c3fd17f483a466 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Mon, 10 Sep 2018 18:09:49 +0900 Subject: Update wm_layer: Set Area to state Change-Id: I039ac972ff2a10300938e50aae0ed57ea8606902 Signed-off-by: Kazumasa Mitsunari --- src/wm_layer.cpp | 21 +++++++++++++++++---- src/wm_layer.hpp | 1 + src/wm_layer_control.cpp | 3 +++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/wm_layer.cpp b/src/wm_layer.cpp index 154d874..28e1cd9 100644 --- a/src/wm_layer.cpp +++ b/src/wm_layer.cpp @@ -86,13 +86,21 @@ void LayerState::setArea(const string& app, const string& area) void LayerState::dump() { - std::string str; + std::string ids, apps; for(const auto& ro : this->render_order) { - str += std::to_string(ro); - str += ","; + ids += std::to_string(ro); + ids += ","; } - DUMP(" render order : %s", str.c_str()); + for(const auto& area : this->area2appid) + { + apps += area.first; + apps += ":"; + apps += area.second; + apps += ","; + } + DUMP(" render order : %s", ids.c_str()); + DUMP(" area, app : %s", apps.c_str()); } WMLayer::WMLayer(json_object* j, unsigned uuid) : tmp_state(), state(), uuid(uuid) @@ -191,6 +199,11 @@ void WMLayer::removeLayerFromState(unsigned layer) this->tmp_state.removeLayer(layer); } +void WMLayer::setAreaToState(const string& app, const string& area) +{ + this->tmp_state.setArea(app, area); +} + void WMLayer::appendArea(const string& area) { this->area_list.push_back(area); diff --git a/src/wm_layer.hpp b/src/wm_layer.hpp index 65182b0..c291151 100644 --- a/src/wm_layer.hpp +++ b/src/wm_layer.hpp @@ -78,6 +78,7 @@ class WMLayer // Manipulation void addLayerToState(unsigned layer); void removeLayerFromState(unsigned layer); + void setAreaToState(const std::string& app, const std::string& area); void terminateApp(unsigned layer); WMError commitChange(); diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp index b4e53c8..4cfedd9 100644 --- a/src/wm_layer_control.cpp +++ b/src/wm_layer_control.cpp @@ -387,8 +387,11 @@ WMError LayerControl::layoutChange(const WMAction& action) { if(wm_layer->hasLayerID(layer)) { + wm_layer->setAreaToState(action.client->appID(), action.area); + /* TODO: manipulate state directly LayerState ls = wm_layer->getLayerState(); ls.setArea(action.client->appID(), action.area); + wm_layer->dump(); */ } } -- cgit 1.2.3-korg