aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-18 11:34:16 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-18 11:38:37 +0900
commitfa3929f4e9e4ebd0027d79ae449ee8de4074de38 (patch)
tree40676b15fbf1d86e1c997d82861fe8dbb14d77e3
parentf9af8481e7221cd61a719c877dfe14b842f66eb7 (diff)
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 <knimitz@witz-inc.co.jp>
-rw-r--r--src/app.cpp50
1 files 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<std::string> 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;
}