summaryrefslogtreecommitdiff
path: root/xmouseless.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmouseless.c')
-rw-r--r--xmouseless.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmouseless.c b/xmouseless.c
index e7dfa1f..b5ce68a 100644
--- a/xmouseless.c
+++ b/xmouseless.c
@@ -215,6 +215,14 @@ void handle_key(KeyCode keycode, Bool is_press) {
int sign = is_press ? 1 : -1;
scrollinfo.speed_x += sign * scroll_bindings[i].x;
scrollinfo.speed_y += sign * scroll_bindings[i].y;
+
+ /* scroll once, workaround for scrolling not working the first time */
+ int scroll_x, scroll_y = 0;
+ if (scrollinfo.speed_x < 0) scroll_x = -1;
+ if (scrollinfo.speed_x > 0) scroll_x = 1;
+ if (scrollinfo.speed_y < 0) scroll_y = -1;
+ if (scrollinfo.speed_y > 0) scroll_y = 1;
+ scroll(scroll_x, scroll_y);
}
}