Modify getAppID
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Fri, 7 Sep 2018 06:12:53 +0000 (15:12 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Fri, 7 Sep 2018 06:12:53 +0000 (15:12 +0900)
Change-Id: I3454b5013e59cd46be081dd30a295dda792deff8
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/applist.cpp
src/applist.hpp
src/window_manager.cpp

index e27bd03..922a89e 100644 (file)
@@ -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)
index 98ce1b8..c31e4a2 100644 (file)
@@ -57,9 +57,11 @@ class AppList
     int  countClient() const;
     std::shared_ptr<WMClient> 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);
index 7ee9dbd..6b2ecf9 100644 (file)
@@ -858,7 +858,7 @@ void WindowManager::startTransitionWrapper(vector<WMAction> &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)