diff options
Diffstat (limited to 'src/applist.cpp')
-rw-r--r-- | src/applist.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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) |