tablet: split proximity and axis update handling
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 14 Jun 2023 00:59:02 +0000 (10:59 +1000)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 4 Dec 2023 10:23:27 +0000 (19:23 +0900)
Let's make this two conditions, this is too confusing to read otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-tablet.c

index 61d99ffcc5bd9e14370d4ec0b73862d91f43ca20..9cdb5896d4cf65d72061a2136ab6cb1b38cb8432 100644 (file)
@@ -1948,16 +1948,14 @@ reprocess:
                tablet_set_status(tablet, TABLET_BUTTONS_RELEASED);
                if (tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT))
                        tablet_set_status(tablet, TABLET_TOOL_LEAVING_CONTACT);
-       } else if (tablet_has_status(tablet, TABLET_AXES_UPDATED) ||
-                  tablet_has_status(tablet, TABLET_TOOL_ENTERING_PROXIMITY)) {
-               if (tablet_has_status(tablet,
-                                     TABLET_TOOL_ENTERING_PROXIMITY)) {
-                       tablet_mark_all_axes_changed(tablet, tool);
-                       update_pressure_offset(tablet, device, tool);
-                       detect_pressure_offset(tablet, device, tool);
-               } else {
-                       update_pressure_offset(tablet, device, tool);
-               }
+       } else if (tablet_has_status(tablet, TABLET_TOOL_ENTERING_PROXIMITY)) {
+               tablet_mark_all_axes_changed(tablet, tool);
+               update_pressure_offset(tablet, device, tool);
+               detect_pressure_offset(tablet, device, tool);
+               detect_tool_contact(tablet, device, tool);
+               sanitize_tablet_axes(tablet, tool);
+       } else if (tablet_has_status(tablet, TABLET_AXES_UPDATED)) {
+               update_pressure_offset(tablet, device, tool);
                detect_tool_contact(tablet, device, tool);
                sanitize_tablet_axes(tablet, tool);
        }