From 7ab55d536e6985b9515c9f2d235a5ca6829df0fa Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Tue, 12 Jun 2018 18:59:17 +0900 Subject: [PATCH] Output log if removing floating surface Change-Id: Ia9e4593858260ce0893d7ec13ed396af0bbed9e7 Signed-off-by: Kazumasa Mitsunari --- src/app.cpp | 1 - src/applist.cpp | 15 +++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 3b42a85..4cc4b3d 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -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)); /* diff --git a/src/applist.cpp b/src/applist.cpp index 7249130..e855705 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -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) -- 2.16.6