diff options
author | José Expósito <jose.exposito89@gmail.com> | 2022-02-25 17:30:51 +0100 |
---|---|---|
committer | José Expósito <jose.exposito89@gmail.com> | 2022-07-11 11:01:35 +0200 |
commit | e00f042f801cf2f5f16bf2f8661d68b40e6d00e0 (patch) | |
tree | 688ebb85d485e8f361d6c68ed59c22c151ee7dbb /backend/libinput | |
parent | c6032d6b1cc1cfb884924bb8afbdd200c3258d9a (diff) |
backend/libinput: code style consistency
Reduce a level of identation in "handle_pointer_axis" to keep the
consistency with "handle_pointer_axis_value120".
Diffstat (limited to 'backend/libinput')
-rw-r--r-- | backend/libinput/pointer.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 50b63c90..841d3dfc 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -103,22 +103,24 @@ void handle_pointer_axis(struct libinput_event *event, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, }; for (size_t i = 0; i < sizeof(axes) / sizeof(axes[0]); ++i) { - if (libinput_event_pointer_has_axis(pevent, axes[i])) { - switch (axes[i]) { - case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL: - wlr_event.orientation = WLR_AXIS_ORIENTATION_VERTICAL; - break; - case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL: - wlr_event.orientation = WLR_AXIS_ORIENTATION_HORIZONTAL; - break; - } - wlr_event.delta = - libinput_event_pointer_get_axis_value(pevent, axes[i]); - wlr_event.delta_discrete = - libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]); - wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP; - wlr_signal_emit_safe(&pointer->events.axis, &wlr_event); + if (!libinput_event_pointer_has_axis(pevent, axes[i])) { + continue; + } + + switch (axes[i]) { + case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL: + wlr_event.orientation = WLR_AXIS_ORIENTATION_VERTICAL; + break; + case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL: + wlr_event.orientation = WLR_AXIS_ORIENTATION_HORIZONTAL; + break; } + wlr_event.delta = + libinput_event_pointer_get_axis_value(pevent, axes[i]); + wlr_event.delta_discrete = + libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]); + wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP; + wlr_signal_emit_safe(&pointer->events.axis, &wlr_event); } wlr_signal_emit_safe(&pointer->events.frame, pointer); } |