mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-23 05:25:27 -04:00
change recent hot zone & inputmethod unfocusable
Signed-off-by: qianlf <qianliangfang@huawei.com> Change-Id: Ibafd8441d0ae89f662be4d0cec653ff535819a07
This commit is contained in:
@@ -25,8 +25,6 @@ public:
|
||||
virtual void AfterForeground() = 0;
|
||||
virtual void AfterBackground() = 0;
|
||||
virtual void AfterFocused() = 0;
|
||||
// TODO: need rename AfterUnFocused to AfterUnfocused
|
||||
virtual void AfterUnFocused() {}
|
||||
virtual void AfterUnfocused() {}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -162,6 +162,14 @@ private:
|
||||
{
|
||||
CALL_LIFECYCLE_LISTENER(AfterUnfocused, UnFocus);
|
||||
}
|
||||
inline void NotifyListenerAfterUnfocused() const
|
||||
{
|
||||
for (auto& listener : lifecycleListeners_) {
|
||||
if (listener != nullptr) {
|
||||
listener->AfterUnfocused();
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void NotifyBeforeDestroy(std::string windowName) const
|
||||
{
|
||||
if (uiContent_ != nullptr) {
|
||||
|
||||
@@ -1215,6 +1215,17 @@ void WindowImpl::ConsumePointerEvent(std::shared_ptr<MMI::PointerEvent>& pointer
|
||||
int32_t action = pointerEvent->GetPointerAction();
|
||||
if (action == MMI::PointerEvent::POINTER_ACTION_DOWN || action == MMI::PointerEvent::POINTER_ACTION_BUTTON_DOWN) {
|
||||
WLOGI("WMS process point down, windowId: %{public}u, action: %{public}d", GetWindowId(), action);
|
||||
if (GetType() == WindowType::WINDOW_TYPE_LAUNCHER_RECENT) {
|
||||
MMI::PointerEvent::PointerItem pointerItem;
|
||||
if (!pointerEvent->GetPointerItem(pointerEvent->GetPointerId(), pointerItem)) {
|
||||
WLOGFW("Point item is invalid");
|
||||
return;
|
||||
}
|
||||
if (!WindowHelper::IsPointInTargetRect(pointerItem.GetGlobalX(), pointerItem.GetGlobalY(), GetRect())) {
|
||||
NotifyListenerAfterUnfocused();
|
||||
return;
|
||||
}
|
||||
}
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessWindowTouchedEvent(property_->GetWindowId());
|
||||
}
|
||||
if (WindowHelper::IsMainFloatingWindow(GetType(), GetMode()) ||
|
||||
@@ -1395,6 +1406,7 @@ void WindowImpl::SetDefaultOption()
|
||||
}
|
||||
case WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT: {
|
||||
property_->SetWindowMode(WindowMode::WINDOW_MODE_FLOATING);
|
||||
property_->SetFocusable(false);
|
||||
break;
|
||||
}
|
||||
case WindowType::WINDOW_TYPE_BOOT_ANIMATION:
|
||||
|
||||
@@ -250,6 +250,8 @@ void WindowLayoutPolicy::CalcAndSetNodeHotZone(Rect layoutOutRect, sptr<WindowNo
|
||||
rect.posY_ -= hotZone;
|
||||
rect.height_ += (hotZone + hotZone);
|
||||
}
|
||||
} else if (node->GetWindowType() == WindowType::WINDOW_TYPE_LAUNCHER_RECENT) {
|
||||
rect = displayRect_;
|
||||
} else if (WindowHelper::IsMainFloatingWindow(node->GetWindowType(), node->GetWindowMode())) {
|
||||
rect.posX_ -= hotZone;
|
||||
rect.posY_ -= hotZone;
|
||||
|
||||
Reference in New Issue
Block a user