+ this->surface_set_layout(surface);
+
+ return WMError::SUCCESS;
+}
+
+WMError App::layoutChange(const WMAction &action)
+{
+ if (action.visible == TaskVisible::INVISIBLE)
+ {
+ // Visibility is not change -> no redraw is required
+ 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;
+}
+
+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 != TaskVisible::INVISIBLE)
+ {
+ this->activate(surface); // Layout Manager task
+ }
+ else
+ {
+ this->deactivate(surface); // Layout Manager task
+ }
+ return WMError::SUCCESS;
+}
+
+WMError App::changeCurrentState(unsigned req_num)
+{
+ HMI_SEQ_DEBUG(req_num, "Change current layout status");
+ bool found = false;
+ auto actions = g_app_list.getActions(req_num, &found);
+ if(!found)
+ {
+ HMI_SEQ_ERROR(req_num, "Action not found");
+ return WMError::LAYOUT_CHANGE_FAIL;
+ }
+
+ struct LayoutState state;
+ std::vector<std::string> areas;
+ bool state_change = false;
+
+ for(const auto &action : actions)
+ {
+ if(action.visible != TaskVisible::INVISIBLE)
+ {
+ // visible == true -> layout changes
+ areas.push_back(action.area);
+ auto client = g_app_list.lookUpClient(action.appid);
+ if(action.area == "normal.full" || action.area == "split.main")
+ {
+ state.main = (int)client->surfaceID(action.role);
+ }
+ else if(action.role == "split.sub")
+ {
+ state.sub = (int)client->surfaceID(action.role);
+ }
+ state_change = true;
+ }