diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-06-22 12:31:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-22 12:31:35 -0400 |
commit | 5055d899550a92d72362efe6add44b2547147599 (patch) | |
tree | 6f003636aee79364ef15af1dd51f743a6ff78031 /example/pointer.c | |
parent | bb16025318e1c3d3844e71e6e8f29b1e8634ec3e (diff) | |
parent | a9547af35833ba06b7446bcba800d7d6a764508c (diff) |
Merge pull request #19 from nyorain/wayland-input
Basic wayland backend input
Diffstat (limited to 'example/pointer.c')
-rw-r--r-- | example/pointer.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |