aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wm_client.cpp10
-rw-r--r--src/wm_client.hpp2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/wm_client.cpp b/src/wm_client.cpp
index 7245549..3bc2d31 100644
--- a/src/wm_client.cpp
+++ b/src/wm_client.cpp
@@ -114,6 +114,11 @@ std::string WMClient::role(unsigned surface) const
return std::string("");
}
+string WMClient::role() const
+{
+ return this->main_role;
+}
+
unsigned WMClient::layerID() const
{
return this->layer;
@@ -167,6 +172,11 @@ bool WMClient::addSurface(const string &role, unsigned surface)
bool WMClient::removeSurfaceIfExist(unsigned surface)
{
bool ret = false;
+ if(surface == this->surface)
+ {
+ this->surface = INVALID_SURFACE_ID;
+ return true;
+ }
for (auto &x : this->role2surface)
{
if (surface == x.second)
diff --git a/src/wm_client.hpp b/src/wm_client.hpp
index 369f084..c78d6f9 100644
--- a/src/wm_client.hpp
+++ b/src/wm_client.hpp
@@ -53,6 +53,7 @@ class WMClient
unsigned surfaceID() const;
std::vector<unsigned> renderOrder() const;
std::string role(unsigned surface) const;
+ std::string role() const;
const std::vector<std::string> &roles() const;
void setRole(const std::string& role);
void appendRole(const std::string& role);
@@ -71,6 +72,7 @@ class WMClient
std::string id;
unsigned layer;
std::string wm_layer_name;
+ std::string main_role;
std::string area;
unsigned surface; // currently, main application has only one surface.
std::vector<std::string> role_list;