aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2017-06-22 17:58:53 +0200
committernyorain <nyorain@gmail.com>2017-06-22 17:58:53 +0200
commitdbde1f734075d47cdada320f056a4e3f7f528755 (patch)
treee645b2fcc5fd4b9a6c5d137e341e0205d793e05c
parent272030652a73fd54472726e3ccd693402868fd35 (diff)
Store wayland backend axis source
-rw-r--r--backend/wayland/wl_seat.c6
-rw-r--r--include/backend/wayland.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 6d3b8b05..aedc4a00 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -77,7 +77,7 @@ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer,
wlr_event.orientation = axis;
wlr_event.time_sec = time / 1000;
wlr_event.time_usec = time * 1000;
- wlr_event.source = WLR_AXIS_SOURCE_CONTINUOUS;
+ wlr_event.source = dev->pointer->state->axis_source;
wl_signal_emit(&dev->pointer->events.axis, &wlr_event);
}
@@ -87,7 +87,9 @@ static void pointer_handle_frame(void *data, struct wl_pointer *wl_pointer) {
static void pointer_handle_axis_source(void *data, struct wl_pointer *wl_pointer,
uint32_t axis_source) {
-
+ struct wlr_input_device *dev = data;
+ assert(dev && dev->pointer && dev->pointer->state);
+ dev->pointer->state->axis_source = axis_source;
}
static void pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer,
diff --git a/include/backend/wayland.h b/include/backend/wayland.h
index df817598..792bad37 100644
--- a/include/backend/wayland.h
+++ b/include/backend/wayland.h
@@ -44,6 +44,7 @@ struct wlr_input_device_state {
};
struct wlr_pointer_state {
+ enum wlr_axis_source axis_source;
struct wlr_output *current_output;
};