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
=== modified file 'include/utouch/frame-xi2.h'
--- include/utouch/frame-xi2.h 2011-02-15 14:01:51 +0000
+++ include/utouch/frame-xi2.h 2011-05-06 15:06:45 +0000
@@ -42,6 +42,10 @@
42const struct utouch_frame *42const struct utouch_frame *
43utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev);43utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev);
4444
45void utouch_frame_set_follow_status_xi2(Display *display, const XIDeviceInfo *dev,
46 int num_accepted, struct utouch_contact **accepted_touches,
47 int num_rejected, struct utouch_contact **rejected_touces);
48
45#ifdef __cplusplus49#ifdef __cplusplus
46}50}
47#endif51#endif
4852
=== modified file 'src/frame-xi2.c'
--- src/frame-xi2.c 2011-04-13 20:01:01 +0000
+++ src/frame-xi2.c 2011-05-06 15:06:45 +0000
@@ -325,3 +325,35 @@
325325
326 return 0;326 return 0;
327}327}
328
329/**
330 * Reject and accept the given touches. Note that you may receive
331 * update events on rejected touches after this call returns.
332 */
333
334void utouch_frame_set_follow_status_xi2(Display *display, const XIDeviceInfo *dev,
335 int num_accepted, struct utouch_contact **accepted_touches,
336 int num_rejected, struct utouch_contact **rejected_touches)
337{
338 int i;
339 for (i=0; i< num_accepted; i++) {
340 /*
341 * XIAllowTouchEvents takes the ID as an unsigned long, but it is given
342 * as an int in XIDeviceEvent. This is a mismatch in the API.
343 */
344 if(!XIAllowTouchEvents(display, dev->deviceid,
345 accepted_touches[i]->id, XITouchOwnerAccept)) {
346 fprintf(stderr, "ERROR: Utouch-frame could not accept touch %d.\n",
347 accepted_touches[i]->id);
348 }
349 }
350
351 for (i=0; i< num_rejected; i++) {
352 if(!XIAllowTouchEvents(display, dev->deviceid,
353 rejected_touches[i]->id, XITouchOwnerRejectEnd)) {
354 fprintf(stderr, "ERROR: Utouch-frame could not reject touch %d.\n",
355 rejected_touches[i]->id);
356 }
357 }
358}
359

Subscribers

People subscribed via source and target branches