+ WMError rc = doTransition(req);
+ if(rc != WMError::SUCCESS)
+ {
+ HMI_SEQ_ERROR(req, errorDescription(rc));
+ }
+}
+
+WMError App::setSurfaceSize(unsigned surface, const std::string &area)
+{
+ // Actually this function is under Layout Manager
+ /* compositor::rect size = this->lm.getAreaSize(area); // compositor::rect size = this->lm_.getAreaSize(area);
+
+ if (!this->controller->surface_exists(surface))
+ {
+ // Block until all pending request are processed by wayland display server
+ // because waiting for the surface of new app is created
+ this->display->roundtrip();
+ }
+ auto &s = this->controller->surfaces[surface];
+ s->set_destination_rectangle(size.x, size.y, size.w, size.h);
+ this->layout_commit();
+
+ // Update area information
+ this->area_info[surface].x = size.x;
+ this->area_info[surface].y = size.y;
+ this->area_info[surface].w = size.w;
+ this->area_info[surface].h = size.h;
+ HMI_DEBUG("wm", "Surface %d rect { %d, %d, %d, %d }",
+ surface, size.x, size.y, size.w, size.h); */
+ this->surface_set_layout(surface);
+
+ return WMError::SUCCESS;
+}
+
+WMError App::layoutChange(const WMAction &action)
+{
+ if(act.visible == false)
+ {
+ return WMError::SUCCESS;
+ }
+ auto client = g_app_list.lookUpClient(action.appid);
+ unsigned surface = client->surfaceID(action.role);
+ if (surface == 0)
+ {
+ HMI_SEQ_ERROR(g_app_list.currentRequestNumber(),
+ "client doesn't have surface with role(%s)", action.role.c_str());
+ return WMError::NOT_REGISTERED;
+ }
+ // Layout Manager
+ WMError ret = this->setSurfaceSize(surface, action.area);
+ return ret;
+}
+
+/* void App::currentAppInvisible(const std::string &role)
+{
+ const char *drawing_name = role.c_str();
+ auto const &surface_id = this->lookup_id(drawing_name);
+ auto layer_id = this->layers.get_layer_id(*surface_id);
+ auto o_state = *this->layers.get_layout_state(*surface_id);
+ struct LayoutState &state = *o_state;
+
+ // disable layers that are above our current layer
+ for (auto const &l : this->layers.mapping)
+ {
+ if (l.second.layer_id <= *layer_id)
+ {
+ continue;
+ }
+
+ bool flush = false;
+ if (l.second.state.main != -1)
+ {
+ this->deactivate(l.second.state.main);
+ l.second.state.main = -1;
+ flush = true;
+ }
+
+ if (l.second.state.sub != -1)
+ {
+ this->deactivate(l.second.state.sub);
+ l.second.state.sub = -1;
+ flush = true;
+ }
+
+ if (flush)
+ {
+ this->layout_commit();
+ }
+ }
+} */
+
+WMError App::visibilityChange(const WMAction &action)
+{
+ auto client = g_app_list.lookUpClient(action.appid);
+ unsigned surface = client->surfaceID(action.role);
+ if(surface == 0)
+ {
+ HMI_SEQ_ERROR(g_app_list.currentRequestNumber(),
+ "client doesn't have surface with role(%s)", action.role.c_str());
+ return WMError::NOT_REGISTERED;
+ }
+
+ if (action.visible)
+ {
+ this->activate(surface); // Layout Manager task
+ }
+ else
+ {
+ this->deactivate(surface); // Layout Manager task
+ }
+ return WMError::SUCCESS;