From e3dd2dd3952bf3ba27858422b1800b31ef8e2ee0 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Mon, 18 Jun 2018 13:39:47 +0900 Subject: [PATCH 1/1] Bug Fix : Show split TODO: Couldn't return to Home when tap shortcut key Change-Id: I53399452b82c838fd034ef1c7eece1deecaa2701 Signed-off-by: Kazumasa Mitsunari --- src/app.cpp | 47 +++++++++++++++++++++++++++++++---------------- src/app.hpp | 2 +- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 0976a19..6689148 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -319,7 +319,7 @@ int App::init_layers() return 0; } -void App::surface_set_layout(int surface_id, optional sub_surface_id) +void App::surface_set_layout(int surface_id, const std::string& area) { if (!this->controller->surface_exists(surface_id)) { @@ -338,7 +338,7 @@ void App::surface_set_layout(int surface_id, optional sub_surface_id) uint32_t layer_id = *o_layer_id; auto const &layer = this->layers.get_layer(layer_id); - auto rect = layer.value().rect; + auto rect = this->layers.getAreaSize(area); auto &s = this->controller->surfaces[surface_id]; int x = rect.x; @@ -754,12 +754,12 @@ WMError App::setInvisibleTask(const std::string &role, bool split) deact_sub.appid = g_app_list.getAppID(state.sub, main, &found); if (!found) { - HMI_SEQ_DEBUG(req, "sub surface ddoesn't exist"); + HMI_SEQ_DEBUG(req, "sub surface doesn't exist"); return WMError::NOT_REGISTERED; } deact_sub.visible = task_visible; deact_sub.end_draw_finished = end_draw_finished; - HMI_SEQ_DEBUG(req, "sub surface ddoesn't exist"); + HMI_SEQ_DEBUG(req, "sub surface doesn't exist"); g_app_list.setAction(req, deact_sub); } } @@ -1062,7 +1062,7 @@ WMError App::doEndDraw(unsigned req_num) WMError App::setSurfaceSize(unsigned surface, const std::string &area) { - this->surface_set_layout(surface); + this->surface_set_layout(surface, area); return WMError::SUCCESS; } @@ -1089,6 +1089,10 @@ WMError App::layoutChange(const WMAction &action) WMError App::visibilityChange(const WMAction &action) { + HMI_SEQ_DEBUG(g_app_list.currentRequestNumber(), "Change visibility"); + if(!g_app_list.contains(action.appid)){ + return WMError::NOT_REGISTERED; + } auto client = g_app_list.lookUpClient(action.appid); unsigned surface = client->surfaceID(action.role); if(surface == 0) @@ -1111,13 +1115,10 @@ WMError App::visibilityChange(const WMAction &action) WMError App::changeCurrentState(unsigned req_num) { - HMI_SEQ_DEBUG(req_num, "Change current layout status"); + HMI_SEQ_DEBUG(req_num, "Change current layout state"); bool trigger_found = false, action_found = false; auto trigger = g_app_list.getRequest(req_num, &trigger_found); auto actions = g_app_list.getActions(req_num, &action_found); - //auto client = g_app_list.lookUpClient(trigger.appid); - //auto pCurState = *this->layers.get_layout_state((int)client->surfaceID(trigger.role)); - //pCurState = state; if (!trigger_found || !action_found) { HMI_SEQ_ERROR(req_num, "Action not found"); @@ -1126,25 +1127,39 @@ WMError App::changeCurrentState(unsigned req_num) // Layout state reset struct LayoutState reset_state{-1, -1}; - HMI_SEQ_DEBUG(req_num."Reset layout state"); + HMI_SEQ_DEBUG(req_num,"Reset layout state"); for (const auto &action : actions) { + if(!g_app_list.contains(action.appid)){ + return WMError::NOT_REGISTERED; + } auto client = g_app_list.lookUpClient(trigger.appid); auto pCurState = *this->layers.get_layout_state((int)client->surfaceID(trigger.role)); - *pCurState = reset_state; + if(pCurState == nullptr) + { + HMI_SEQ_ERROR(req_num, "Counldn't find current status"); + continue; + } + pCurState->main = reset_state.main; + pCurState->sub = reset_state.sub; } - for(const auto &action : actions) + HMI_SEQ_DEBUG(req_num, "Change state"); + for (const auto &action : actions) { auto client = g_app_list.lookUpClient(action.appid); - auto pLayerCurState = *this->layers.get_layout_state((int)client->surfaceID(trigger.role)); - int surface = -1; - if(action.visible != TaskVisible::INVISIBLE) + auto pLayerCurState = *this->layers.get_layout_state((int)client->surfaceID(action.role)); + if (pLayerCurState == nullptr) { - surface = (int)client->surfaceID(action.role); + HMI_SEQ_ERROR(req_num, "Counldn't find current status"); + continue; } + int surface = -1; + if (action.visible != TaskVisible::INVISIBLE) { + surface = (int)client->surfaceID(action.role); + HMI_SEQ_INFO(req_num, "Change %s state visible area : %s", action.role.c_str(), action.area.c_str()); // visible == true -> layout changes if(action.area == "normal.full" || action.area == "split.main") { diff --git a/src/app.hpp b/src/app.hpp index 04caf12..047436b 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -250,7 +250,7 @@ struct App int init_layers(); - void surface_set_layout(int surface_id, optional sub_surface_id = nullopt); + void surface_set_layout(int surface_id, const std::string& area = ""); void layout_commit(); // TMC WM Events to clients -- 2.16.6