Add gitlab issue/merge request templates
[apps/agl-service-windowmanager.git] / src / wm_client.cpp
index ff08a00..4bccb8c 100644 (file)
@@ -72,6 +72,8 @@ WMClient::WMClient(const string &appid, const string &role)
     : id(appid),
       layer(0),
       is_source_set(false),
+      is_active(false),
+      main_role(role),
       role2surface(0),
       evname2afb_event(0)
 {
@@ -90,6 +92,8 @@ WMClient::WMClient(const string &appid, const string &role)
 WMClient::WMClient(const string &appid, unsigned layer, const string &role)
     : id(appid),
       layer(layer),
+      is_source_set(false),
+      is_active(false),
       main_role(role),
       role2surface(0),
       evname2afb_event(0)
@@ -116,11 +120,21 @@ string WMClient::role() const
     return this->main_role;
 }
 
+void WMClient::setRole(const string& role)
+{
+    this->main_role = role;
+}
+
 unsigned WMClient::layerID() const
 {
     return this->layer;
 }
 
+void WMClient::setLayerID(unsigned id)
+{
+    this->layer = id;
+}
+
 unsigned WMClient::surfaceID() const
 {
     return this->surface;
@@ -131,6 +145,20 @@ void WMClient::registerSurface(unsigned surface)
     this->surface = surface;
 }
 
+void WMClient::activate()
+{
+    if(!this->isActive())
+        this->emitActive(true); // emit when state is changed
+    this->is_active = true;
+}
+
+void WMClient::deactivate()
+{
+    if(this->isActive())
+        this->emitActive(false); // emit when state is changed
+    this->is_active = false;
+}
+
 /**
  * Add surface to the client
  *