touchpad: split handling the state into a separate function
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 1 Sep 2014 07:05:49 +0000 (17:05 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 18 Sep 2014 03:29:39 +0000 (13:29 +1000)
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad.c

index d831b836bab0c85ae6022a2278451ad35e965e2c..7202a6633b1116aab3dc0eadafac963ca0f6a836 100644 (file)
@@ -593,6 +593,15 @@ tp_post_events(struct tp_dispatch *tp, uint64_t time)
                pointer_notify_motion(&tp->device->base, time, dx, dy);
 }
 
+static void
+tp_handle_state(struct tp_dispatch *tp,
+               uint64_t time)
+{
+       tp_process_state(tp, time);
+       tp_post_events(tp, time);
+       tp_post_process_state(tp, time);
+}
+
 static void
 tp_process(struct evdev_dispatch *dispatch,
           struct evdev_device *device,
@@ -613,9 +622,7 @@ tp_process(struct evdev_dispatch *dispatch,
                tp_process_key(tp, e, time);
                break;
        case EV_SYN:
-               tp_process_state(tp, time);
-               tp_post_events(tp, time);
-               tp_post_process_state(tp, time);
+               tp_handle_state(tp, time);
                break;
        }
 }