aboutsummaryrefslogtreecommitdiff
path: root/examples/pointer.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-18 22:18:25 +0100
committeremersion <contact@emersion.fr>2017-11-18 22:18:25 +0100
commit72d877658aaf309eb066e3b9825c5f59177b15c3 (patch)
tree2f7123b9cc9f6a99c1d8351272d69572b7d1e811 /examples/pointer.c
parent1523082d5d74ca40f468bec04c23ed47049bb4d7 (diff)
parentfa36ac90f70787176a5cfdb6fa6835aa1226f697 (diff)
Merge branch 'master' into seat-views
Diffstat (limited to 'examples/pointer.c')
-rw-r--r--examples/pointer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/pointer.c b/examples/pointer.c
index 476cc617..8fafb3d6 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -55,7 +55,7 @@ struct sample_state {
};
struct touch_point {
- int32_t slot;
+ int32_t touch_id;
double x, y;
};
@@ -199,7 +199,7 @@ static void handle_touch_up(struct wl_listener *listener, void *data) {
struct wlr_event_touch_up *event = data;
for (size_t i = 0; i < sample->touch_points->length; ++i) {
struct touch_point *point = sample->touch_points->items[i];
- if (point->slot == event->slot) {
+ if (point->touch_id == event->touch_id) {
wlr_list_del(sample->touch_points, i);
break;
}
@@ -212,7 +212,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
struct sample_state *sample = wl_container_of(listener, sample, touch_down);
struct wlr_event_touch_down *event = data;
struct touch_point *point = calloc(1, sizeof(struct touch_point));
- point->slot = event->slot;
+ point->touch_id = event->touch_id;
point->x = event->x_mm / event->width_mm;
point->y = event->y_mm / event->height_mm;
if (wlr_list_add(sample->touch_points, point) == -1) {
@@ -228,7 +228,7 @@ static void handle_touch_motion(struct wl_listener *listener, void *data) {
struct wlr_event_touch_motion *event = data;
for (size_t i = 0; i < sample->touch_points->length; ++i) {
struct touch_point *point = sample->touch_points->items[i];
- if (point->slot == event->slot) {
+ if (point->touch_id == event->touch_id) {
point->x = event->x_mm / event->width_mm;
point->y = event->y_mm / event->height_mm;
break;