mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-18 16:24:27 -04:00
modify point down
Signed-off-by: l00574490 <liuqi149@huawei.com> Change-Id: Ie7e95cec03d67fe2a6eb916ea9d8aeb5c22c39ae
This commit is contained in:
@@ -110,6 +110,8 @@ void IPCSpecificInterfaceFuzzTest1(sptr<IRemoteObject> proxy, MessageParcel& sen
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IWindowManager::WindowManagerMessage::TRANS_ID_GET_TOP_WINDOW_ID),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IWindowManager::WindowManagerMessage::TRANS_ID_NOTIFY_READY_MOVE_OR_DRAG),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IWindowManager::WindowManagerMessage::TRANS_ID_PROCESS_POINT_DOWN),
|
||||
sendData, reply, option);
|
||||
proxy->SendRequest(static_cast<uint32_t>(IWindowManager::WindowManagerMessage::TRANS_ID_PROCESS_POINT_UP),
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "singleton_container.h"
|
||||
#include "wm_common.h"
|
||||
#include "window_adapter.h"
|
||||
#include "window_impl.h"
|
||||
#include "window_test_utils.h"
|
||||
|
||||
using namespace testing;
|
||||
@@ -113,17 +112,10 @@ namespace {
|
||||
*/
|
||||
HWTEST_F(WindowTouchOutsideTest, onTouchInside, Function | MediumTest | Level3)
|
||||
{
|
||||
sptr<WindowOption> option = new WindowOption();
|
||||
option->SetWindowName(firstWindowInfo_.name);
|
||||
option->SetWindowMode(firstWindowInfo_.mode);
|
||||
option->SetWindowType(firstWindowInfo_.type);
|
||||
option->SetWindowRect(firstWindowInfo_.rect);
|
||||
sptr<WindowImpl> firstWindow = new WindowImpl(option);
|
||||
firstWindow->Create("");
|
||||
const sptr<Window> &firstWindow = Utils::CreateTestWindow(firstWindowInfo_);
|
||||
firstWindow->RegisterTouchOutsideListener(windowlistener1_);
|
||||
firstWindow->Show();
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(firstWindow->GetWindowId(),
|
||||
firstWindow->property_, firstWindow->moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(firstWindow->GetWindowId());
|
||||
usleep(WAIT_CALLBACK_US);
|
||||
ASSERT_TRUE(!windowlistener1_->isTouchOutside_);
|
||||
firstWindow->Destroy();
|
||||
@@ -138,18 +130,10 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutside, Function | MediumTest | Level3)
|
||||
{
|
||||
const sptr<Window> &firstWindow = Utils::CreateTestWindow(firstWindowInfo_);
|
||||
firstWindow->RegisterTouchOutsideListener(windowlistener1_);
|
||||
|
||||
sptr<WindowOption> secondOption = new WindowOption();
|
||||
secondOption->SetWindowName(secondWindowInfo_.name);
|
||||
secondOption->SetWindowMode(secondWindowInfo_.mode);
|
||||
secondOption->SetWindowType(secondWindowInfo_.type);
|
||||
secondOption->SetWindowRect(secondWindowInfo_.rect);
|
||||
sptr<WindowImpl> secondWindow = new WindowImpl(secondOption);
|
||||
secondWindow->Create("");
|
||||
const sptr<Window> &secondWindow = Utils::CreateTestWindow(secondWindowInfo_);
|
||||
firstWindow->Show();
|
||||
secondWindow->Show();
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(secondWindow->GetWindowId(),
|
||||
secondWindow->property_, secondWindow->moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(secondWindow->GetWindowId());
|
||||
usleep(WAIT_CALLBACK_US);
|
||||
ASSERT_TRUE(windowlistener1_->isTouchOutside_);
|
||||
firstWindow->Destroy();
|
||||
@@ -165,17 +149,9 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideNotShow, Function | MediumTest |
|
||||
{
|
||||
const sptr<Window> &firstWindow = Utils::CreateTestWindow(firstWindowInfo_);
|
||||
firstWindow->RegisterTouchOutsideListener(windowlistener1_);
|
||||
|
||||
sptr<WindowOption> secondOption = new WindowOption();
|
||||
secondOption->SetWindowName(secondWindowInfo_.name);
|
||||
secondOption->SetWindowMode(secondWindowInfo_.mode);
|
||||
secondOption->SetWindowType(secondWindowInfo_.type);
|
||||
secondOption->SetWindowRect(secondWindowInfo_.rect);
|
||||
sptr<WindowImpl> secondWindow = new WindowImpl(secondOption);
|
||||
secondWindow->Create("");
|
||||
const sptr<Window> &secondWindow = Utils::CreateTestWindow(secondWindowInfo_);
|
||||
secondWindow->Show();
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(secondWindow->GetWindowId(),
|
||||
secondWindow->property_, secondWindow->moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(secondWindow->GetWindowId());
|
||||
usleep(WAIT_CALLBACK_US);
|
||||
ASSERT_TRUE(!windowlistener1_->isTouchOutside_);
|
||||
firstWindow->Destroy();
|
||||
@@ -197,16 +173,9 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideForAllWindow, Function | MediumTe
|
||||
firstWindow->Show();
|
||||
secondWindow->Show();
|
||||
|
||||
sptr<WindowOption> thirdOption = new WindowOption();
|
||||
thirdOption->SetWindowName(thirdWindowInfo_.name);
|
||||
thirdOption->SetWindowMode(thirdWindowInfo_.mode);
|
||||
thirdOption->SetWindowType(thirdWindowInfo_.type);
|
||||
thirdOption->SetWindowRect(thirdWindowInfo_.rect);
|
||||
sptr<WindowImpl> thirdWindow = new WindowImpl(thirdOption);
|
||||
thirdWindow->Create("");
|
||||
const sptr<Window> &thirdWindow = Utils::CreateTestWindow(thirdWindowInfo_);
|
||||
thirdWindow->Show();
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(thirdWindow->GetWindowId(),
|
||||
thirdWindow->property_, thirdWindow->moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(thirdWindow->GetWindowId());
|
||||
usleep(WAIT_CALLBACK_US);
|
||||
ASSERT_TRUE(windowlistener1_->isTouchOutside_);
|
||||
ASSERT_TRUE(windowlistener2_->isTouchOutside_);
|
||||
|
||||
@@ -54,7 +54,6 @@ private:
|
||||
void OnVsyncTimeOut();
|
||||
|
||||
std::mutex mtx_;
|
||||
uint32_t vsyncCount_ = 0;
|
||||
bool hasRequestedVsync_ = false;
|
||||
bool hasInitVsyncReceiver_ = false;
|
||||
bool isMainHandlerAvailable_ = true;
|
||||
|
||||
@@ -43,8 +43,9 @@ public:
|
||||
virtual WMError RequestFocus(uint32_t windowId);
|
||||
virtual WMError GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type, AvoidArea& avoidRect);
|
||||
virtual WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId);
|
||||
virtual void ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
virtual void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty);
|
||||
virtual void ProcessPointDown(uint32_t windowId);
|
||||
virtual void ProcessPointUp(uint32_t windowId);
|
||||
virtual void MinimizeAllAppWindows(DisplayId displayId);
|
||||
virtual WMError ToggleShownStateForAllAppWindows();
|
||||
|
||||
@@ -56,10 +56,6 @@ void VsyncStation::RequestVsync(const std::shared_ptr<VsyncCallback>& vsyncCallb
|
||||
return;
|
||||
}
|
||||
hasRequestedVsync_ = true;
|
||||
vsyncCount_++;
|
||||
if (vsyncCount_ & 0x01) { // write log every 2 vsync
|
||||
WLOGFD("Request next vsync.");
|
||||
}
|
||||
vsyncHandler_->RemoveTask(VSYNC_TIME_OUT_TASK);
|
||||
vsyncHandler_->PostTask(vsyncTimeoutCallback_, VSYNC_TIME_OUT_TASK, VSYNC_TIME_OUT_MILLISECONDS);
|
||||
}
|
||||
@@ -82,9 +78,6 @@ void VsyncStation::VsyncCallbackInner(int64_t timestamp)
|
||||
vsyncCallbacks = vsyncCallbacks_;
|
||||
vsyncCallbacks_.clear();
|
||||
vsyncHandler_->RemoveTask(VSYNC_TIME_OUT_TASK);
|
||||
if (vsyncCount_ & 0x01) { // write log every 2 vsync
|
||||
WLOGFD("[WM] On vsync callback.");
|
||||
}
|
||||
}
|
||||
for (const auto& callback: vsyncCallbacks) {
|
||||
callback->onCallback(timestamp);
|
||||
|
||||
@@ -106,13 +106,21 @@ WMError WindowAdapter::GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type,
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
void WindowAdapter::ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
void WindowAdapter::NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty)
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN();
|
||||
|
||||
return windowManagerServiceProxy_->ProcessPointDown(windowId, windowProperty, moveDragProperty);
|
||||
return windowManagerServiceProxy_->NotifyServerReadyToMoveOrDrag(windowId, windowProperty, moveDragProperty);
|
||||
}
|
||||
|
||||
void WindowAdapter::ProcessPointDown(uint32_t windowId)
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN();
|
||||
|
||||
return windowManagerServiceProxy_->ProcessPointDown(windowId);
|
||||
}
|
||||
|
||||
void WindowAdapter::ProcessPointUp(uint32_t windowId)
|
||||
{
|
||||
INIT_PROXY_CHECK_RETURN();
|
||||
|
||||
@@ -1091,8 +1091,7 @@ WMError WindowImpl::Show(uint32_t reason, bool withAnimation)
|
||||
SingletonContainer::Get<WindowAdapter>().MinimizeAllAppWindows(property_->GetDisplayId());
|
||||
} else {
|
||||
WLOGFI("window is already shown id: %{public}u, raise to top", property_->GetWindowId());
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId(),
|
||||
property_, moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId());
|
||||
}
|
||||
NotifyAfterForeground(false);
|
||||
return WMError::WM_OK;
|
||||
@@ -1539,7 +1538,8 @@ void WindowImpl::StartMove()
|
||||
return;
|
||||
}
|
||||
moveDragProperty_->startMoveFlag_ = true;
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId(), property_, moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().NotifyServerReadyToMoveOrDrag(property_->GetWindowId(),
|
||||
property_, moveDragProperty_);
|
||||
WLOGFI("[StartMove] windowId %{public}u", GetWindowId());
|
||||
}
|
||||
|
||||
@@ -2151,7 +2151,7 @@ void WindowImpl::ReadyToMoveOrDragWindow(int32_t globalX, int32_t globalY, int32
|
||||
|
||||
if (GetType() == WindowType::WINDOW_TYPE_DOCK_SLICE) {
|
||||
moveDragProperty_->startMoveFlag_ = true;
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId(),
|
||||
SingletonContainer::Get<WindowAdapter>().NotifyServerReadyToMoveOrDrag(property_->GetWindowId(),
|
||||
property_, moveDragProperty_);
|
||||
} else if (!WindowHelper::IsPointInTargetRect(moveDragProperty_->startPointPosX_,
|
||||
moveDragProperty_->startPointPosY_, moveDragProperty_->startRectExceptFrame_) ||
|
||||
@@ -2161,7 +2161,7 @@ void WindowImpl::ReadyToMoveOrDragWindow(int32_t globalX, int32_t globalY, int32
|
||||
moveDragProperty_->startPointPosY_, moveDragProperty_->startRectExceptCorner_)))) {
|
||||
moveDragProperty_->startDragFlag_ = true;
|
||||
UpdateDragType();
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId(),
|
||||
SingletonContainer::Get<WindowAdapter>().NotifyServerReadyToMoveOrDrag(property_->GetWindowId(),
|
||||
property_, moveDragProperty_);
|
||||
}
|
||||
|
||||
@@ -2256,8 +2256,7 @@ void WindowImpl::ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent>& p
|
||||
return;
|
||||
}
|
||||
}
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId(),
|
||||
property_, moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId());
|
||||
}
|
||||
|
||||
// If point event type is up, should reset start move flag
|
||||
@@ -2468,7 +2467,7 @@ void WindowImpl::NotifyTouchOutside()
|
||||
void WindowImpl::NotifyTouchDialogTarget()
|
||||
{
|
||||
std::vector<sptr<IDialogTargetTouchListener>> dialogTargetTouchListeners;
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId(), property_, moveDragProperty_);
|
||||
SingletonContainer::Get<WindowAdapter>().ProcessPointDown(property_->GetWindowId());
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
dialogTargetTouchListeners = dialogTargetTouchListeners_;
|
||||
|
||||
@@ -48,7 +48,8 @@ public:
|
||||
WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId);
|
||||
void NotifyDisplayStateChange(DisplayId defaultDisplayId, sptr<DisplayInfo> displayInfo,
|
||||
const std::map<DisplayId, sptr<DisplayInfo>>& displayInfoMap, DisplayStateChangeType type);
|
||||
WMError ProcessPointDown(uint32_t windowId, sptr<MoveDragProperty>& moveDragProperty);
|
||||
WMError NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<MoveDragProperty>& moveDragProperty);
|
||||
WMError ProcessPointDown(uint32_t windowId);
|
||||
WMError ProcessPointUp(uint32_t windowId);
|
||||
void MinimizeAllAppWindows(DisplayId displayId);
|
||||
WMError ToggleShownStateForAllAppWindows();
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
void MinimizeAbility(const wptr<WindowNode> &node, bool isFromUser);
|
||||
|
||||
void ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent);
|
||||
bool NotifyWindowReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
bool NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty);
|
||||
void NotifyWindowEndUpMovingOrDragging(uint32_t windowId);
|
||||
void NotifyWindowRemovedOrDestroyed(uint32_t windowId);
|
||||
|
||||
@@ -90,8 +90,9 @@ public:
|
||||
WMError DestroyWindow(uint32_t windowId, bool onlySelf = false) override;
|
||||
WMError RequestFocus(uint32_t windowId) override;
|
||||
AvoidArea GetAvoidAreaByType(uint32_t windowId, AvoidAreaType avoidAreaType) override;
|
||||
void ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty) override;
|
||||
void ProcessPointDown(uint32_t windowId) override;
|
||||
void ProcessPointUp(uint32_t windowId) override;
|
||||
WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId) override;
|
||||
void MinimizeAllAppWindows(DisplayId displayId) override;
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
TRANS_ID_UPDATE_AVOIDAREA_LISTENER,
|
||||
TRANS_ID_UPDATE_RS_TREE,
|
||||
TRANS_ID_BIND_DIALOG_TARGET,
|
||||
TRANS_ID_NOTIFY_READY_MOVE_OR_DRAG,
|
||||
};
|
||||
virtual WMError CreateWindow(sptr<IWindow>& window, sptr<WindowProperty>& property,
|
||||
const std::shared_ptr<RSSurfaceNode>& surfaceNode,
|
||||
@@ -72,8 +73,9 @@ public:
|
||||
virtual WMError RequestFocus(uint32_t windowId) = 0;
|
||||
virtual AvoidArea GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type) = 0;
|
||||
virtual WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId) = 0;
|
||||
virtual void ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
virtual void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty) = 0;
|
||||
virtual void ProcessPointDown(uint32_t windowId) = 0;
|
||||
virtual void ProcessPointUp(uint32_t windowId) = 0;
|
||||
virtual void MinimizeAllAppWindows(DisplayId displayId) = 0;
|
||||
virtual WMError ToggleShownStateForAllAppWindows() = 0;
|
||||
|
||||
@@ -38,8 +38,9 @@ public:
|
||||
WMError RequestFocus(uint32_t windowId) override;
|
||||
AvoidArea GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type) override;
|
||||
WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId) override;
|
||||
void ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty) override;
|
||||
void ProcessPointDown(uint32_t windowId) override;
|
||||
void ProcessPointUp(uint32_t windowId) override;
|
||||
void MinimizeAllAppWindows(DisplayId displayId) override;
|
||||
WMError ToggleShownStateForAllAppWindows() override;
|
||||
|
||||
@@ -663,7 +663,28 @@ AvoidArea WindowController::GetAvoidAreaByType(uint32_t windowId, AvoidAreaType
|
||||
return windowRoot_->GetAvoidAreaByType(windowId, avoidAreaType);
|
||||
}
|
||||
|
||||
WMError WindowController::ProcessPointDown(uint32_t windowId, sptr<MoveDragProperty>& moveDragProperty)
|
||||
WMError WindowController::NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<MoveDragProperty>& moveDragProperty)
|
||||
{
|
||||
auto node = windowRoot_->GetWindowNode(windowId);
|
||||
if (node == nullptr) {
|
||||
WLOGFW("could not find window");
|
||||
return WMError::WM_ERROR_NULLPTR;
|
||||
}
|
||||
if (!node->currentVisibility_) {
|
||||
WLOGFE("this window is not visible and not in window tree, windowId: %{public}u", windowId);
|
||||
return WMError::WM_ERROR_INVALID_OPERATION;
|
||||
}
|
||||
|
||||
// if start dragging or start moving dock_slice, need to update size change reason
|
||||
if ((moveDragProperty->startMoveFlag_ && node->GetWindowType() == WindowType::WINDOW_TYPE_DOCK_SLICE) ||
|
||||
moveDragProperty->startDragFlag_) {
|
||||
WMError res = windowRoot_->UpdateSizeChangeReason(windowId, WindowSizeChangeReason::DRAG_START);
|
||||
return res;
|
||||
}
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
WMError WindowController::ProcessPointDown(uint32_t windowId)
|
||||
{
|
||||
auto node = windowRoot_->GetWindowNode(windowId);
|
||||
if (node == nullptr) {
|
||||
@@ -677,13 +698,6 @@ WMError WindowController::ProcessPointDown(uint32_t windowId, sptr<MoveDragPrope
|
||||
|
||||
NotifyTouchOutside(node);
|
||||
|
||||
// if start dragging or start moving dock_slice, need to update size change reason
|
||||
if ((moveDragProperty->startMoveFlag_ && node->GetWindowType() == WindowType::WINDOW_TYPE_DOCK_SLICE) ||
|
||||
moveDragProperty->startDragFlag_) {
|
||||
WMError res = windowRoot_->UpdateSizeChangeReason(windowId, WindowSizeChangeReason::DRAG_START);
|
||||
return res;
|
||||
}
|
||||
|
||||
WLOGFI("process point down, windowId: %{public}u", windowId);
|
||||
WMError zOrderRes = windowRoot_->RaiseZOrderForAppWindow(node);
|
||||
WMError focusRes = windowRoot_->RequestFocus(windowId);
|
||||
|
||||
@@ -203,7 +203,7 @@ pid_t WindowInnerManager::GetPid()
|
||||
return pid_;
|
||||
}
|
||||
|
||||
bool WindowInnerManager::NotifyWindowReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
bool WindowInnerManager::NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty)
|
||||
{
|
||||
if (moveDragController_->GetActiveWindowId() != INVALID_WINDOW_ID) {
|
||||
@@ -211,7 +211,7 @@ bool WindowInnerManager::NotifyWindowReadyToMoveOrDrag(uint32_t windowId, sptr<W
|
||||
return false;
|
||||
}
|
||||
moveDragController_->HandleReadyToMoveOrDrag(windowId, windowProperty, moveDragProperty);
|
||||
WLOGFI("NotifyWindowReadyToMoveOrDrag, windowId: %{public}u", windowId);
|
||||
WLOGFI("NotifyServerReadyToMoveOrDrag, windowId: %{public}u", windowId);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -711,7 +711,7 @@ void DisplayChangeListener::OnScreenshot(DisplayId displayId)
|
||||
WindowManagerService::GetInstance().OnScreenshot(displayId);
|
||||
}
|
||||
|
||||
void WindowManagerService::ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
void WindowManagerService::NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty)
|
||||
{
|
||||
if (windowProperty == nullptr || moveDragProperty == nullptr) {
|
||||
@@ -721,7 +721,7 @@ void WindowManagerService::ProcessPointDown(uint32_t windowId, sptr<WindowProper
|
||||
|
||||
PostAsyncTask([this, windowId, windowProperty, moveDragProperty]() mutable {
|
||||
if (moveDragProperty->startDragFlag_ || moveDragProperty->startMoveFlag_) {
|
||||
bool res = WindowInnerManager::GetInstance().NotifyWindowReadyToMoveOrDrag(windowId,
|
||||
bool res = WindowInnerManager::GetInstance().NotifyServerReadyToMoveOrDrag(windowId,
|
||||
windowProperty, moveDragProperty);
|
||||
if (!res) {
|
||||
WLOGFE("invalid operation");
|
||||
@@ -729,7 +729,14 @@ void WindowManagerService::ProcessPointDown(uint32_t windowId, sptr<WindowProper
|
||||
}
|
||||
windowController_->InterceptInputEventToServer(windowId);
|
||||
}
|
||||
windowController_->ProcessPointDown(windowId, moveDragProperty);
|
||||
windowController_->NotifyServerReadyToMoveOrDrag(windowId, moveDragProperty);
|
||||
});
|
||||
}
|
||||
|
||||
void WindowManagerService::ProcessPointDown(uint32_t windowId)
|
||||
{
|
||||
PostAsyncTask([this, windowId]() {
|
||||
windowController_->ProcessPointDown(windowId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ WMError WindowManagerProxy::SetWindowAnimationController(const sptr<RSIWindowAni
|
||||
return static_cast<WMError>(ret);
|
||||
}
|
||||
|
||||
void WindowManagerProxy::ProcessPointDown(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
void WindowManagerProxy::NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
|
||||
sptr<MoveDragProperty>& moveDragProperty)
|
||||
{
|
||||
MessageParcel data;
|
||||
@@ -302,6 +302,25 @@ void WindowManagerProxy::ProcessPointDown(uint32_t windowId, sptr<WindowProperty
|
||||
WLOGFE("Failed to write moveDragProperty!");
|
||||
return;
|
||||
}
|
||||
if (Remote()->SendRequest(static_cast<uint32_t>(WindowManagerMessage::TRANS_ID_NOTIFY_READY_MOVE_OR_DRAG),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManagerProxy::ProcessPointDown(uint32_t windowId)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return;
|
||||
}
|
||||
if (!data.WriteUint32(windowId)) {
|
||||
WLOGFE("Write windowId failed");
|
||||
return;
|
||||
}
|
||||
if (Remote()->SendRequest(static_cast<uint32_t>(WindowManagerMessage::TRANS_ID_PROCESS_POINT_DOWN),
|
||||
data, reply, option) != ERR_NONE) {
|
||||
WLOGFE("SendRequest failed");
|
||||
|
||||
@@ -98,11 +98,16 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M
|
||||
UnregisterWindowManagerAgent(type, windowManagerAgentProxy);
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_PROCESS_POINT_DOWN: {
|
||||
case WindowManagerMessage::TRANS_ID_NOTIFY_READY_MOVE_OR_DRAG: {
|
||||
uint32_t windowId = data.ReadUint32();
|
||||
sptr<WindowProperty> windowProperty = data.ReadStrongParcelable<WindowProperty>();
|
||||
sptr<MoveDragProperty> moveDragProperty = data.ReadStrongParcelable<MoveDragProperty>();
|
||||
ProcessPointDown(windowId, windowProperty, moveDragProperty);
|
||||
NotifyServerReadyToMoveOrDrag(windowId, windowProperty, moveDragProperty);
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_PROCESS_POINT_DOWN: {
|
||||
uint32_t windowId = data.ReadUint32();
|
||||
ProcessPointDown(windowId);
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_PROCESS_POINT_UP: {
|
||||
|
||||
Reference in New Issue
Block a user