From 5f9c942f4680d42af58180a9e03bbd095286025c Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Fri, 12 Mar 2021 17:31:49 +0800 Subject: [PATCH 1/4] link #I3B60A Change-Id: I51bfd129e0443ef7b26b0baf67a71dbb68111965 --- services/ims/input_event_hub.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/ims/input_event_hub.cpp b/services/ims/input_event_hub.cpp index 9e973dd..e3daed5 100755 --- a/services/ims/input_event_hub.cpp +++ b/services/ims/input_event_hub.cpp @@ -17,9 +17,11 @@ #include "graphic_log.h" namespace OHOS { +namespace { const uint32_t TOUCH_DEV_ID = 1; const uint32_t MOUSE_DEV_ID = 2; const uint32_t UNKNOW_DEV_ID = 32; +} IInputInterface* InputEventHub::inputInterface_ = nullptr; InputReportEventCb InputEventHub::callback_ = { 0 }; InputEventHub::ReadCallback InputEventHub::readCallback_ = nullptr; -- Gitee From 8be03ad1a29f617823f9f8451079f0a28ab6786b Mon Sep 17 00:00:00 2001 From: benb365 Date: Mon, 15 Mar 2021 19:46:52 +0800 Subject: [PATCH 2/4] link https://gitee.com/benb365/graphic_ui/issues/I3BHSE Change-Id: I9b9704481d612c199aa3f46f4123eb2ede0855ab --- README.md | 7 ++++--- README_zh.md | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ece6457..572e996 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,10 @@ hb build lite_wms ## Repositories Involved -/hmf/graphic/surface +[Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics-subsystem.md) -/hmf/graphic/ui +[graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README.md) -/hmf/graphic/utils +[graphic_ui](https://gitee.com/openharmony/graphic_ui/blob/master/README.md) +[graphic_utils](https://gitee.com/openharmony/graphic_utils/blob/master/README.md) \ No newline at end of file diff --git a/README_zh.md b/README_zh.md index 603f734..85199cc 100644 --- a/README_zh.md +++ b/README_zh.md @@ -51,9 +51,10 @@ hb build lite_wms ## 相关仓 -/hmf/graphic/surface +[图形子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%9B%BE%E5%BD%A2%E5%AD%90%E7%B3%BB%E7%BB%9F.md) -/hmf/graphic/ui +[graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README_zh.md) -/hmf/graphic/utils +[graphic_ui](https://gitee.com/openharmony/graphic_ui/blob/master/README_zh.md) +[graphic_utils](https://gitee.com/openharmony/graphic_utils/blob/master/README_zh.md) \ No newline at end of file -- Gitee From 737dd02020ea4234d499267999384ca86bf6aa1a Mon Sep 17 00:00:00 2001 From: benb365 Date: Tue, 16 Mar 2021 11:00:47 +0800 Subject: [PATCH 3/4] Add self to related repo. Change-Id: I471bc681db7d7e4591ab5667ce6f2dbf202400ac --- README.md | 2 ++ README_zh.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 572e996..4fd39d2 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ hb build lite_wms [Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics-subsystem.md) +**graphic_wms** + [graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README.md) [graphic_ui](https://gitee.com/openharmony/graphic_ui/blob/master/README.md) diff --git a/README_zh.md b/README_zh.md index 85199cc..595bb6b 100644 --- a/README_zh.md +++ b/README_zh.md @@ -53,6 +53,8 @@ hb build lite_wms [图形子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%9B%BE%E5%BD%A2%E5%AD%90%E7%B3%BB%E7%BB%9F.md) +**graphic_wms** + [graphic_surface](https://gitee.com/openharmony/graphic_surface/blob/master/README_zh.md) [graphic_ui](https://gitee.com/openharmony/graphic_ui/blob/master/README_zh.md) -- Gitee From be2b6ca2080aa2cbde23c25e8babfd0545b223ca Mon Sep 17 00:00:00 2001 From: liqiang Date: Tue, 16 Mar 2021 15:14:31 +0800 Subject: [PATCH 4/4] add alwaysInvoke attribute to accelerate ui Change-Id: I366332f4ac2a661cb6f32b2638224c4a573eea32 --- frameworks/ims/input_event_client_proxy.h | 2 ++ frameworks/ims/input_event_listener_proxy.cpp | 1 + interfaces/innerkits/input_event_listener_proxy.h | 14 ++++++++++++++ services/ims/input_event_client_proxy.cpp | 8 ++++++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/frameworks/ims/input_event_client_proxy.h b/frameworks/ims/input_event_client_proxy.h index 5f45063..21fb3be 100755 --- a/frameworks/ims/input_event_client_proxy.h +++ b/frameworks/ims/input_event_client_proxy.h @@ -51,10 +51,12 @@ private: struct ClientInfo { SvcIdentity svc; uint32_t cdId; + bool alwaysInvoke; }; std::map clientInfoMap_; static pthread_mutex_t lock_; + int16_t lastState_ = 0; InputEventClientProxy(const InputEventClientProxy&) = delete; InputEventClientProxy& operator=(const InputEventClientProxy&) = delete; diff --git a/frameworks/ims/input_event_listener_proxy.cpp b/frameworks/ims/input_event_listener_proxy.cpp index 8456f2b..55c752e 100755 --- a/frameworks/ims/input_event_listener_proxy.cpp +++ b/frameworks/ims/input_event_listener_proxy.cpp @@ -81,6 +81,7 @@ bool InputEventListenerProxy::RegisterInputEventListener(RawEventListener* liste return false; } IpcIoPushSvc(&io, &svc); + IpcIoPushBool(&io, listener->IsAlwaysInvoke()); int32_t ret = proxy_->Invoke(proxy_, LITEIMS_CLIENT_REGISTER, &io, NULL, NULL); if (ret != 0) { GRAPHIC_LOGE("Client register failed, ret=%d", ret); diff --git a/interfaces/innerkits/input_event_listener_proxy.h b/interfaces/innerkits/input_event_listener_proxy.h index 08d4ac2..56bd732 100755 --- a/interfaces/innerkits/input_event_listener_proxy.h +++ b/interfaces/innerkits/input_event_listener_proxy.h @@ -31,7 +31,21 @@ public: class RawEventListener { public: + RawEventListener() : alwaysInvoke_(false) {} + virtual ~RawEventListener() {} + + void EnableAlwaysInvoke(bool alwaysInvoke) + { + alwaysInvoke_ = alwaysInvoke; + } + + bool IsAlwaysInvoke() + { + return alwaysInvoke_; + } virtual void OnRawEvent(const RawEvent& event) = 0; + protected: + bool alwaysInvoke_; }; bool RegisterInputEventListener(RawEventListener* listener); diff --git a/services/ims/input_event_client_proxy.cpp b/services/ims/input_event_client_proxy.cpp index b627579..0a5fa4a 100755 --- a/services/ims/input_event_client_proxy.cpp +++ b/services/ims/input_event_client_proxy.cpp @@ -44,6 +44,7 @@ void InputEventClientProxy::AddListener(const void* origin, IpcIo* req, IpcIo* r } pid_t pid = GetCallingPid(origin); SvcIdentity* sid = IpcIoPopSvc(req); + bool alwaysInvoke = IpcIoPopBool(req); if (sid == nullptr) { GRAPHIC_LOGE("Pop Svc failed."); return; @@ -59,7 +60,7 @@ void InputEventClientProxy::AddListener(const void* origin, IpcIo* req, IpcIo* r GRAPHIC_LOGE("Register death callback failed!"); return; } - struct ClientInfo clientInfo = { svc, cbId }; + struct ClientInfo clientInfo = { svc, cbId, alwaysInvoke }; pthread_mutex_lock(&lock_); clientInfoMap_.insert(std::make_pair(pid, clientInfo)); pthread_mutex_unlock(&lock_); @@ -97,8 +98,11 @@ void InputEventClientProxy::OnRawEvent(const RawEvent& event) pthread_mutex_lock(&lock_); std::map::iterator it; for (it = clientInfoMap_.begin(); it != clientInfoMap_.end(); it++) { - SendRequest(nullptr, it->second.svc, 0, &io, nullptr, LITEIPC_FLAG_ONEWAY, nullptr); + if (it->second.alwaysInvoke || (event.state != lastState_)) { + SendRequest(nullptr, it->second.svc, 0, &io, nullptr, LITEIPC_FLAG_ONEWAY, nullptr); + } } + lastState_ = event.state; pthread_mutex_unlock(&lock_); } } // namespace OHOS -- Gitee