Output log if removing floating surface
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Tue, 12 Jun 2018 09:59:17 +0000 (18:59 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Tue, 12 Jun 2018 09:59:17 +0000 (18:59 +0900)
Change-Id: Ia9e4593858260ce0893d7ec13ed396af0bbed9e7
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
src/app.cpp
src/applist.cpp

index 3b42a85..4cc4b3d 100644 (file)
@@ -894,7 +894,6 @@ void App::api_activate_surface(char const *appid, char const *drawing_name, char
         reply("role should be set with surface");
         return;
     }
-    g_app_list.dumpFloatingSurfaces();
     g_app_list.removeFloatingSurface(client->surfaceID(role));
 
     /*
index 7249130..e855705 100644 (file)
@@ -102,7 +102,7 @@ WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface)
 {
     WMError ret = WMError::NO_ENTRY;
 
-    auto rmv_begin = std::remove_if(this->floating_surfaces.begin(), this->floating_surfaces.end(),
+    auto fwd_itr = std::remove_if(this->floating_surfaces.begin(), this->floating_surfaces.end(),
                                     [pid, surface, &ret](FloatingSurface x) {
                                         if(pid == x.pid){
                                             *surface = x.surface_id;
@@ -113,7 +113,11 @@ WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface)
                                             return false;
                                         }
                                     });
-    this->floating_surfaces.erase(rmv_begin, this->floating_surfaces.end());
+    if (fwd_itr != this->floating_surfaces.cend())
+    {
+        HMI_INFO("wm", "pop floating surface: %d", *surface);
+    }
+    this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end());
     return ret;
 }
 
@@ -137,11 +141,14 @@ void AppList::addFloatingSurface(unsigned surface, unsigned pid)
 void AppList::removeFloatingSurface(unsigned surface)
 {
     this->dumpFloatingSurfaces();
-    auto rmv_begin = std::remove_if(this->floating_surfaces.begin(), this->floating_surfaces.end(),
+    auto fwd_itr = std::remove_if(this->floating_surfaces.begin(), this->floating_surfaces.end(),
                                        [surface](FloatingSurface x) {
                                            return x.surface_id == surface;
                                        });
-    this->floating_surfaces.erase(rmv_begin, this->floating_surfaces.end());
+    if(fwd_itr != this->floating_surfaces.cend()){
+        HMI_INFO("wm", "remove floating surface: %d", surface);
+    }
+    this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end());
 }
 
 WMError AppList::appendRole(const std::string &id, const std::string &role, unsigned surface)