Blob Blame History Raw
From 8f8e763baf795f66704ac5cc6f9a6c0da361ad3b Mon Sep 17 00:00:00 2001
From: lichangze <lichangze@uniontech.com>
Date: Tue, 14 Jun 2022 15:02:54 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?=
 =?UTF-8?q?=E9=81=BF=E5=85=8Dlibinput=E6=89=93=E5=8D=B0=E8=BF=87=E5=A4=9A?=
 =?UTF-8?q?=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

libinput打印过多日志

Log: 增加判断避免libinput打印过多日志
Influence: libinput打印过多日志
Bug: https://pms.uniontech.com/bug-view-138051.html
Change-Id: I290d52bf6db04c3b1d99bcce616271098889402f
---
 system/gesture/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/system/gesture/core.c b/system/gesture/core.c
index b9b16a0b..5d232e24 100644
--- a/system/gesture/core.c
+++ b/system/gesture/core.c
@@ -617,6 +617,9 @@ handle_mouse_events(struct libinput_event *ev, int type)
 
     struct libinput_event_pointer *mouse = libinput_event_get_pointer_event(ev);
     enum libinput_pointer_axis_source source = libinput_event_pointer_get_axis_source(mouse);
+    if (!libinput_event_pointer_has_axis(mouse, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL)) {
+        return;
+    }
     double value = libinput_event_pointer_get_axis_value(mouse, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
 
     handleMouseEvent(type, source,value);
@@ -684,14 +687,11 @@ handle_events(struct libinput *li, struct movement *m)
             break;
         }
         case LIBINPUT_EVENT_KEYBOARD_KEY: {
-                handle_keyboard_events(ev, type);
+            handle_keyboard_events(ev, type);
             break;
         }
-        case LIBINPUT_EVENT_POINTER_MOTION:
-        case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
-        case LIBINPUT_EVENT_POINTER_BUTTON:
         case LIBINPUT_EVENT_POINTER_AXIS: {
-                handle_mouse_events(ev, type);
+            handle_mouse_events(ev, type);
             break;
         }
         default:
-- 
2.38.1