summaryrefslogtreecommitdiff
path: root/src/bindings.c
diff options
context:
space:
mode:
authorRune K. Svendsen <runesvend@gmail.com>2013-03-07 21:50:00 +0100
committerKristian Høgsberg <krh@bitplanet.net>2013-03-18 21:43:17 -0400
commit14b2fe702016d117538ce08eb4177d88154e9bc5 (patch)
tree68595f382f6531962ece7c3951a4ab1ab3a285c2 /src/bindings.c
parent976a050f8f150287335773a0549f47a6311e8d40 (diff)
Eat scroll event if a key binding function is executed because of it.
When an axis (scroll) event results in a key binding function being executed, eat the scroll event so the underlying window doesn't receive it. Thanks to Scott Moreau for helping me solve this.
Diffstat (limited to 'src/bindings.c')
-rw-r--r--src/bindings.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bindings.c b/src/bindings.c
index 6456f79b..322736d8 100644
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -250,7 +250,7 @@ weston_compositor_run_button_binding(struct weston_compositor *compositor,
}
}
-WL_EXPORT void
+WL_EXPORT int
weston_compositor_run_axis_binding(struct weston_compositor *compositor,
struct weston_seat *seat,
uint32_t time, uint32_t axis,
@@ -262,8 +262,11 @@ weston_compositor_run_axis_binding(struct weston_compositor *compositor,
if (b->axis == axis && b->modifier == seat->modifier_state) {
weston_axis_binding_handler_t handler = b->handler;
handler(&seat->seat, time, axis, value, b->data);
+ return 1;
}
}
+
+ return 0;
}
WL_EXPORT int