模态窗口绑定提前

输入事件特殊处理

Change-Id: I5266eb98b82d8feea4147eb4878cb691b2100368
Signed-off-by: zhengjiangliang <zhengjiangliang@huawei.com>
This commit is contained in:
zhengjiangliang 2022-09-24 15:47:13 +08:00
parent ebd6903db2
commit cfad5b4272
3 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,7 @@ public:
static const int32_t KEYCODE_FN = 0;
static const int32_t KEYCODE_NUMPAD_RIGHT_PAREN = 1;
static const int32_t KEYCODE_0 = 2;
static const int32_t KEYCODE_BACK = 3;
int32_t GetKeyCode() const
{

View File

@ -48,6 +48,10 @@ void WindowInputChannel::HandleKeyEvent(std::shared_ptr<MMI::KeyEvent>& keyEvent
keyEvent->MarkProcessed();
return;
}
if (keyEvent->GetKeyCode() == MMI::KeyEvent::KEYCODE_BACK) {
keyEvent->MarkProcessed();
return;
}
}
bool inputMethodHasProcessed = false;

View File

@ -1319,7 +1319,21 @@ WMError WindowController::BindDialogTarget(uint32_t& windowId, sptr<IRemoteObjec
if (windowRoot_->CheckMultiDialogWindows(node->GetWindowType(), targetToken)) {
return WMError::WM_ERROR_INVALID_WINDOW;
}
node->dialogTargetToken_ = targetToken;
sptr<WindowNode> parentNode = windowRoot_->FindDialogCallerNode(node->GetWindowType(), node->dialogTargetToken_);
if (parentNode != nullptr) {
auto position = parentNode->children_.end();
for (auto iter = parentNode->children_.begin(); iter < parentNode->children_.end(); ++iter) {
if ((*iter)->priority_ > node->priority_) {
position = iter;
break;
}
}
parentNode->children_.insert(position, node);
}
return WMError::WM_OK;
}
} // namespace OHOS