mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 15:00:12 +00:00
模态窗口绑定提前
输入事件特殊处理 Change-Id: I5266eb98b82d8feea4147eb4878cb691b2100368 Signed-off-by: zhengjiangliang <zhengjiangliang@huawei.com>
This commit is contained in:
parent
ebd6903db2
commit
cfad5b4272
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user