From b73c8310f2ca06b356135ef3a1b17e5cb6e2ec5d Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Fri, 31 Aug 2018 11:42:20 +0900 Subject: Update wm_client Change-Id: I76854f8a452c582d9bb3f795f6e779106304ad7a Signed-off-by: Kazumasa Mitsunari --- src/wm_client.cpp | 10 ++++++++++ src/wm_client.hpp | 2 ++ 2 files changed, 12 insertions(+) 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 renderOrder() const; std::string role(unsigned surface) const; + std::string role() const; const std::vector &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 role_list; -- cgit 1.2.3-korg