summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-04-24 12:36:43 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-04-24 13:52:09 +1000
commita310a5f6230840483678986ee8645dbdea150dd0 (patch)
tree385099c6052e4882469a11b7601d1feaee9bc271
parentaa028b726966fab117c64afd5d5efa861c2d4666 (diff)
touchpad: minor code cleanup
No functional changes, just reducing to one instance of the call with a variable parameter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-mt-touchpad-buttons.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index be6dc7c..c907ecc 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -439,18 +439,22 @@ tp_button_handle_state(struct tp_dispatch *tp, uint64_t time)
if (t->state == TOUCH_END) {
tp_button_handle_event(tp, t, BUTTON_EVENT_UP, time);
} else if (t->dirty) {
+ enum button_event event;
+
if (is_inside_bottom_right_area(tp, t))
- tp_button_handle_event(tp, t, BUTTON_EVENT_IN_BOTTOM_R, time);
+ event = BUTTON_EVENT_IN_BOTTOM_R;
else if (is_inside_bottom_left_area(tp, t))
- tp_button_handle_event(tp, t, BUTTON_EVENT_IN_BOTTOM_L, time);
+ event = BUTTON_EVENT_IN_BOTTOM_L;
else if (is_inside_top_right_area(tp, t))
- tp_button_handle_event(tp, t, BUTTON_EVENT_IN_TOP_R, time);
+ event = BUTTON_EVENT_IN_TOP_R;
else if (is_inside_top_middle_area(tp, t))
- tp_button_handle_event(tp, t, BUTTON_EVENT_IN_TOP_M, time);
+ event = BUTTON_EVENT_IN_TOP_M;
else if (is_inside_top_left_area(tp, t))
- tp_button_handle_event(tp, t, BUTTON_EVENT_IN_TOP_L, time);
+ event = BUTTON_EVENT_IN_TOP_L;
else
- tp_button_handle_event(tp, t, BUTTON_EVENT_IN_AREA, time);
+ event = BUTTON_EVENT_IN_AREA;
+
+ tp_button_handle_event(tp, t, event, time);
}
if (tp->queued & TOUCHPAD_EVENT_BUTTON_RELEASE)
tp_button_handle_event(tp, t, BUTTON_EVENT_RELEASE, time);