diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-10-18 13:37:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 13:37:35 -0400 |
commit | 30dbb8eba053fda2e17678feb6cebffc424e1e57 (patch) | |
tree | 09ff2da2b266f152e590db839f0c5e2016888552 /swaybar/i3bar.c | |
parent | d88b7a63f487587d9507164de31d6e8508b32801 (diff) | |
parent | 499150a91b706b9829ca763ede9b97c573b51cb7 (diff) |
Merge pull request #2874 from ianyfan/swaybar
swaybar: separate input code to new file
Diffstat (limited to 'swaybar/i3bar.c')
-rw-r--r-- | swaybar/i3bar.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c index 1d754808..3ea74e13 100644 --- a/swaybar/i3bar.c +++ b/swaybar/i3bar.c @@ -9,6 +9,7 @@ #include "swaybar/bar.h" #include "swaybar/config.h" #include "swaybar/i3bar.h" +#include "swaybar/input.h" #include "swaybar/status_line.h" void i3bar_block_unref(struct i3bar_block *block) { @@ -284,32 +285,3 @@ enum hotspot_event_handling i3bar_block_send_click(struct status_line *status, json_object_put(event_json); return HOTSPOT_IGNORE; } - -enum x11_button wl_button_to_x11_button(uint32_t button) { - switch (button) { - case BTN_LEFT: - return LEFT; - case BTN_MIDDLE: - return MIDDLE; - case BTN_RIGHT: - return RIGHT; - case BTN_SIDE: - return BACK; - case BTN_EXTRA: - return FORWARD; - default: - return NONE; - } -} - -enum x11_button wl_axis_to_x11_button(uint32_t axis, wl_fixed_t value) { - switch (axis) { - case WL_POINTER_AXIS_VERTICAL_SCROLL: - return wl_fixed_to_double(value) < 0 ? SCROLL_UP : SCROLL_DOWN; - case WL_POINTER_AXIS_HORIZONTAL_SCROLL: - return wl_fixed_to_double(value) < 0 ? SCROLL_LEFT : SCROLL_RIGHT; - default: - wlr_log(WLR_DEBUG, "Unexpected axis value on mouse scroll"); - return NONE; - } -} |