From 1022ddf831865956795c2bd71c07176ab7eedf66 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Fri, 7 Sep 2018 15:12:53 +0900 Subject: Modify getAppID Change-Id: I3454b5013e59cd46be081dd30a295dda792deff8 Signed-off-by: Kazumasa Mitsunari --- src/applist.cpp | 15 ++++++++++++++- src/applist.hpp | 4 +++- src/window_manager.cpp | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/applist.cpp b/src/applist.cpp index e27bd03..922a89e 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -167,7 +167,7 @@ int AppList::countClient() const * @return AppID * @attention If AppID is not found, param found will be false. */ -string AppList::getAppID(unsigned surface, const string& role, bool* found) const +/* string AppList::getAppID(unsigned surface, const string& role, bool* found) const { *found = false; for (const auto &x : this->app2client) @@ -178,6 +178,19 @@ string AppList::getAppID(unsigned surface, const string& role, bool* found) cons } } return string(""); +} */ + +string AppList::getAppID(unsigned surface, bool* found) const +{ + *found = false; + for (const auto &x : this->app2client) + { + if(x.second->surfaceID() == surface){ + *found = true; + return x.second->appID(); + } + } + return string(""); } WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface) diff --git a/src/applist.hpp b/src/applist.hpp index 98ce1b8..c31e4a2 100644 --- a/src/applist.hpp +++ b/src/applist.hpp @@ -57,9 +57,11 @@ class AppList int countClient() const; std::shared_ptr lookUpClient(const std::string &appid); void removeSurface(unsigned surface); - std::string getAppID(unsigned surface, const std::string &role, bool *found) const; + //std::string getAppID(unsigned surface, const std::string &role, bool *found) const; + std::string getAppID(unsigned surface, bool* found) const; WMError appendRole(const std::string &appid, const std::string &role); + // Floating surface void addFloatingClient(const std::string &appid, unsigned layer, const std::string &role); void addFloatingSurface(const std::string &appid, unsigned surface, unsigned pid); diff --git a/src/window_manager.cpp b/src/window_manager.cpp index 7ee9dbd..6b2ecf9 100644 --- a/src/window_manager.cpp +++ b/src/window_manager.cpp @@ -858,7 +858,7 @@ void WindowManager::startTransitionWrapper(vector &actions) { bool found; auto const &surface_id = this->id_alloc.lookup(act.role); - string appid = g_app_list.getAppID(*surface_id, act.role, &found); + string appid = g_app_list.getAppID(*surface_id, &found); if (!found) { if (TaskVisible::INVISIBLE == act.visible) -- cgit 1.2.3-korg