aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_layer.cpp')
-rw-r--r--src/wm_layer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/wm_layer.cpp b/src/wm_layer.cpp
index 4eceb43..e1454f8 100644
--- a/src/wm_layer.cpp
+++ b/src/wm_layer.cpp
@@ -66,6 +66,12 @@ void LayerState::removeLayer(unsigned layer)
this->render_order.erase(fwd_itr, this->render_order.end());
}
+bool LayerState::hasLayer(unsigned layer)
+{
+ auto itr = std::find(this->render_order.begin(), this->render_order.end(), layer);
+ return (itr != this->render_order.end()) ? true : false;
+}
+
void LayerState::attachAppToArea(const string& app, const string& area)
{
this->area2appid[area] = app;
@@ -96,6 +102,7 @@ WMLayer::WMLayer(json_object* j, unsigned wm_layer_id) : tmp_state(), state(), w
this->role_list = jh::getStringFromJson(j, "role");
this->id_begin = static_cast<unsigned>(jh::getIntFromJson(j, "id_range_begin"));
this->id_end = static_cast<unsigned>(jh::getIntFromJson(j, "id_range_end"));
+ this->screen = jh::getIntFromJson(j, "screen"); // screen is not defined in layers.json, screen is set to 0
if (name.empty())
{
@@ -183,6 +190,11 @@ void WMLayer::removeLayerFromState(unsigned layer)
this->tmp_state.removeLayer(layer);
}
+bool WMLayer::hasLayerFromState(unsigned layer)
+{
+ this->tmp_state.hasLayer(layer);
+}
+
void WMLayer::attachAppToArea(const string& app, const string& area)
{
this->tmp_state.attachAppToArea(app, area);
@@ -250,7 +262,7 @@ void WMLayer::undo()
void WMLayer::dump()
{
DUMP("===== wm layer status =====");
- DUMP("Layer :%s", this->name.c_str());
+ DUMP("Layer :%s on screen %d", this->name.c_str(), this->screen);
DUMP(" [Current]");
this->state.dump();
DUMP(" [To be]");