aboutsummaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-05-14 16:47:45 -0400
committerDrew DeVault <sir@cmpwn.com>2016-05-14 16:47:45 -0400
commitae027aad5a4a1c83cb4dd073aaeb2276b2e659ac (patch)
tree26292b5ece4da11f72f7b3b486d2dc5c83caa026 /sway/handlers.c
parent2c9553a6fdfa7986fadeb3ac3883622a3c7aa8c5 (diff)
parente73dde3b1057c8248eb24b3c15c99f398472eeba (diff)
Merge pull request #662 from Hummer12007/scroll
Support floating_scroll sideways
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 67275575..931e1340 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -723,12 +723,18 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
bool handle_pointer_scroll(wlc_handle view, uint32_t time, const struct wlc_modifiers* modifiers,
uint8_t axis_bits, double _amount[2]) {
if (!(modifiers->mods ^ config->floating_mod)) {
- int amount = (int)_amount[0];
- if (amount > 0) {
+ int x_amount = (int)_amount[0];
+ int y_amount = (int)_amount[1];
+ if (x_amount > 0) {
handle_command(config->floating_scroll_up_cmd);
- } else if (amount < 0) {
+ } else if (x_amount < 0) {
handle_command(config->floating_scroll_down_cmd);
}
+ if (y_amount > 0) {
+ handle_command(config->floating_scroll_right_cmd);
+ } else if (y_amount < 0) {
+ handle_command(config->floating_scroll_left_cmd);
+ }
}
return EVENT_PASSTHROUGH;
}