From fa3929f4e9e4ebd0027d79ae449ee8de4074de38 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Mon, 18 Jun 2018 11:34:16 +0900 Subject: [PATCH 1/1] Bug Fix 1 : Enable split.sub invisible when tap shortcut key split.sub surface is not invisible when other shortcut key is tapped Change-Id: I8c9887865d73a516e076676d5ef52ae9ab1e5da2 Signed-off-by: Kazumasa Mitsunari --- src/app.cpp | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 0c89804..0976a19 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1112,46 +1112,56 @@ WMError App::visibilityChange(const WMAction &action) 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) + 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"); return WMError::LAYOUT_CHANGE_FAIL; } - struct LayoutState state; - std::vector areas; - bool state_change = false; + // Layout state reset + struct LayoutState reset_state{-1, -1}; + HMI_SEQ_DEBUG(req_num."Reset layout state"); + for (const auto &action : actions) + { + auto client = g_app_list.lookUpClient(trigger.appid); + auto pCurState = *this->layers.get_layout_state((int)client->surfaceID(trigger.role)); + *pCurState = reset_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) + { + surface = (int)client->surfaceID(action.role); + } + 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); + pLayerCurState->main = surface; } else if(action.role == "split.sub") { - state.sub = (int)client->surfaceID(action.role); + pLayerCurState->sub = surface; + } + else + { + // normalfull + pLayerCurState->main = surface; } - state_change = true; } } - if(state_change) - { - auto trigger = g_app_list.getRequest(req_num, &found); - auto client = g_app_list.lookUpClient(trigger.appid); - auto pCurState = *this->layers.get_layout_state((int)client->surfaceID(trigger.role)); - struct LayoutState &curState = *pCurState; - curState = state; - } - return WMError::SUCCESS; } -- 2.16.6