Merge lp:~jpakkane/frame/xi2-accept-reject into lp:frame

Proposed by Jussi Pakkanen
Status: Rejected
Rejected by: Jussi Pakkanen
Proposed branch: lp:~jpakkane/frame/xi2-accept-reject
Merge into: lp:frame
Diff against target: 54 lines (+36/-0)
2 files modified
include/utouch/frame-xi2.h (+4/-0)
src/frame-xi2.c (+32/-0)
To merge this branch: bzr merge lp:~jpakkane/frame/xi2-accept-reject
Reviewer Review Type Date Requested Status
Open Input Framework Team Pending
Review via email: mp+60199@code.launchpad.net

Description of the change

This branch adds the functionality to reject or accept touches via the XInput2 protocol.

This is a very "just try out something" thing and probably should not be merged outright. Think of it more as a suggestion to get things going.

To post a comment you must log in.
lp:~jpakkane/frame/xi2-accept-reject updated
37. By Jussi Pakkanen

Comment clarification.

38. By Jussi Pakkanen

Comment clarification v2.

Unmerged revisions

38. By Jussi Pakkanen

Comment clarification v2.

37. By Jussi Pakkanen

Comment clarification.

36. By Jussi Pakkanen

Log failed accept/release attempts.

35. By Jussi Pakkanen

Renamed function parameters.

34. By Jussi Pakkanen

Tentative implementation to reject and accept touches.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/utouch/frame-xi2.h'
2--- include/utouch/frame-xi2.h 2011-02-15 14:01:51 +0000
3+++ include/utouch/frame-xi2.h 2011-05-06 15:06:45 +0000
4@@ -42,6 +42,10 @@
5 const struct utouch_frame *
6 utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev);
7
8+void utouch_frame_set_follow_status_xi2(Display *display, const XIDeviceInfo *dev,
9+ int num_accepted, struct utouch_contact **accepted_touches,
10+ int num_rejected, struct utouch_contact **rejected_touces);
11+
12 #ifdef __cplusplus
13 }
14 #endif
15
16=== modified file 'src/frame-xi2.c'
17--- src/frame-xi2.c 2011-04-13 20:01:01 +0000
18+++ src/frame-xi2.c 2011-05-06 15:06:45 +0000
19@@ -325,3 +325,35 @@
20
21 return 0;
22 }
23+
24+/**
25+ * Reject and accept the given touches. Note that you may receive
26+ * update events on rejected touches after this call returns.
27+ */
28+
29+void utouch_frame_set_follow_status_xi2(Display *display, const XIDeviceInfo *dev,
30+ int num_accepted, struct utouch_contact **accepted_touches,
31+ int num_rejected, struct utouch_contact **rejected_touches)
32+{
33+ int i;
34+ for (i=0; i< num_accepted; i++) {
35+ /*
36+ * XIAllowTouchEvents takes the ID as an unsigned long, but it is given
37+ * as an int in XIDeviceEvent. This is a mismatch in the API.
38+ */
39+ if(!XIAllowTouchEvents(display, dev->deviceid,
40+ accepted_touches[i]->id, XITouchOwnerAccept)) {
41+ fprintf(stderr, "ERROR: Utouch-frame could not accept touch %d.\n",
42+ accepted_touches[i]->id);
43+ }
44+ }
45+
46+ for (i=0; i< num_rejected; i++) {
47+ if(!XIAllowTouchEvents(display, dev->deviceid,
48+ rejected_touches[i]->id, XITouchOwnerRejectEnd)) {
49+ fprintf(stderr, "ERROR: Utouch-frame could not reject touch %d.\n",
50+ rejected_touches[i]->id);
51+ }
52+ }
53+}
54+

Subscribers

People subscribed via source and target branches