From a9547af35833ba06b7446bcba800d7d6a764508c Mon Sep 17 00:00:00 2001 From: nyorain Date: Thu, 22 Jun 2017 18:21:28 +0200 Subject: Fix pointer example for wayland backend --- example/pointer.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'example/pointer.c') diff --git a/example/pointer.c b/example/pointer.c index 9a2f33d7..035af240 100644 --- a/example/pointer.c +++ b/example/pointer.c @@ -54,6 +54,13 @@ static void handle_pointer_motion(struct pointer_state *pstate, state->cur_y += d_y; } +static void handle_pointer_motion_absolute(struct pointer_state *pstate, + double x, double y) { + struct sample_state *state = pstate->compositor->data; + state->cur_x = x; + state->cur_y = y; +} + static void handle_pointer_button(struct pointer_state *pstate, uint32_t button, enum wlr_button_state state) { struct sample_state *sample = pstate->compositor->data; @@ -109,6 +116,7 @@ int main(int argc, char *argv[]) { compositor.output_add_cb = handle_output_add; compositor.output_frame_cb = handle_output_frame; compositor.pointer_motion_cb = handle_pointer_motion; + compositor.pointer_motion_absolute_cb = handle_pointer_motion_absolute; compositor.pointer_button_cb = handle_pointer_button; compositor.pointer_axis_cb = handle_pointer_axis; compositor_init(&compositor); -- cgit v1.2.3