+ for(auto &y : this->service2surfaces)
+ {
+ if(y.second == surface)
+ {
+ HMI_INFO("wm", "Remove surface from client %s: role %s, surface: %d",
+ this->id.c_str(), y.first.c_str(), y.second);
+ this->service2surfaces.erase(y.first);
+ }
+ }
+ if(this->surface == surface)
+ {
+ this->surface = INVALID_SURFACE_ID;
+ // TODO: If main surface vanishes, how do we treat?
+ // Window Manager doesn't know it's means dead or on purpose.
+ // option1: remove service surface and notify to the service.
+ // option2: waiting the application calls deallocate.
+ HMI_INFO("wm", "Main surface vanishes");
+ }