mirror of
https://github.com/openharmony/third_party_mtdev.git
synced 2026-07-20 22:18:23 -04:00
f6630c7890
Change-Id: I6f58a4a3152470b9d8036d72f6a2b7be8d85fda5
49 lines
1.7 KiB
Diff
49 lines
1.7 KiB
Diff
Copyright (C) 2021-2023 Huawei Device Co., Ltd.
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at\n
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
|
|
diff -Naur old/src/core.c new/src/core.c
|
|
--- old/src/core.c 2021-01-01 00:00:00.000000000 +0800
|
|
+++ new/src/core.c 2021-01-01 00:00:00.000000000 +0800
|
|
@@ -252,7 +252,8 @@
|
|
struct input_event ev;
|
|
int i, count = 0;
|
|
foreach_bit(i, prop)
|
|
- if (get_sval(&state->data[slot], i) != get_sval(data, i))
|
|
+ if (mtdev_mt2abs(i) == ABS_MT_POSITION_X || mtdev_mt2abs(i) == ABS_MT_POSITION_Y ||
|
|
+ get_sval(&state->data[slot], i) != get_sval(data, i))
|
|
count++;
|
|
if (!count)
|
|
return;
|
|
@@ -268,7 +269,8 @@
|
|
foreach_bit(i, prop) {
|
|
ev.code = mtdev_mt2abs(i);
|
|
ev.value = get_sval(data, i);
|
|
- if (get_sval(&state->data[slot], i) != ev.value) {
|
|
+ if (ev.code == ABS_MT_POSITION_X || ev.code == ABS_MT_POSITION_Y ||
|
|
+ get_sval(&state->data[slot], i) != ev.value) {
|
|
evbuf_put(&state->outbuf, &ev);
|
|
set_sval(&state->data[slot], i, ev.value);
|
|
}
|
|
@@ -297,7 +299,11 @@
|
|
foreach_bit(slot, state->used) {
|
|
if (state->data[slot].tracking_id != id)
|
|
continue;
|
|
+#ifdef DISABLE_FILTER
|
|
+ (void)filter_data;
|
|
+#else
|
|
filter_data(state, dev, &data[i], prop[i], slot);
|
|
+#endif
|
|
push_slot_changes(state, &data[i], prop[i], slot, syn);
|
|
SETBIT(used, slot);
|
|
id = MT_ID_NULL;
|