diff options
author | Drew DeVault <[email protected]> | 2016-05-08 10:27:40 -0700 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2016-05-08 10:27:40 -0700 |
commit | db0e1d6bc138100d351a41191f8e631d0b2b941e (patch) | |
tree | ed2cbb25cb60138bac65178e50ab9cf717dad787 /sway/handlers.c | |
parent | 6abdc0755945a982638ce2341d2ed1f96a6c5e4e (diff) | |
parent | 0c495eecde82c3b7a2827c713badfd13536f5507 (diff) |
Merge pull request #645 from Hummer12007/floating_scroll
Implement configurable floating scroll behavior
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index b82456e2..67275575 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -723,26 +723,11 @@ 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)) { - switch (config->floating_scroll) { - case FSB_GAPS_INNER: - case FSB_GAPS_OUTER: - { - int amount = (int)_amount[0]; - int i,j; - for (i = 0; i < root_container.children->length; ++i) { - swayc_t *op = root_container.children->items[i]; - for (j = 0; j < op->children->length; ++j) { - swayc_t *ws = op->children->items[j]; - if (config->floating_scroll == FSB_GAPS_INNER) { - container_map(ws, add_gaps, &amount); - } else { - ws->gaps += amount; - } - } - } - arrange_windows(&root_container, -1, -1); - break; - } + int amount = (int)_amount[0]; + if (amount > 0) { + handle_command(config->floating_scroll_up_cmd); + } else if (amount < 0) { + handle_command(config->floating_scroll_down_cmd); } } return EVENT_PASSTHROUGH; |