Merge lp:~bregma/geis/lp-741404 into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 136
Proposed branch: lp:~bregma/geis/lp-741404
Merge into: lp:geis
Diff against target: 132 lines (+56/-2)
4 files modified
ChangeLog (+8/-0)
configure.ac (+6/-2)
libutouch-geis/backend/xcb/geis_xcb_backend.c (+6/-0)
m4/ax_enable_xi2.m4 (+36/-0)
To merge this branch: bzr merge lp:~bregma/geis/lp-741404
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Henrik Rydberg (community) Approve
Duncan McGreggor (community) Needs Information
Review via email: mp+57420@code.launchpad.net

Description of the change

Makes direct use of XI2.1 code optional at compile time.

Some downstream distributions stopped being able to compile when the XI2.1 stuff went in. This will restore buildability at the cost of device enumeration. The default configuration is to enable and build with XI2.1 support. Support can either be disabled through configure or automatically if XI2.1 is not available on the build system.

To post a comment you must log in.
Revision history for this message
Duncan McGreggor (oubiwann) wrote :

"This will restore buildability at the cost of device enumeration."

Stephen, could you elaborate a little more on the reason for device enumeration being "lost"?

And to clarify:

Device will continue to work if XI2.1 is available and support for it is compiled, yes?

review: Needs Information
Revision history for this message
Henrik Rydberg (rydberg) wrote :

Are the two ways to test for the hidden attribute equivalent? If so, perhaps it should be saved for oneiric?

review: Needs Information
Revision history for this message
Stephen M. Webb (bregma) wrote :

> "This will restore buildability at the cost of device enumeration."
>
> Stephen, could you elaborate a little more on the reason for device
> enumeration being "lost"?

Absolutely.

Utouch-geis uses XI2.1 calls to the X server to enumerate the available multi-touch capable input devices. The functionality available through XI2.1 is an API-breaking change currently available only in Ubuntu 11.04 and later or those other distributions willing to port the Ubuntu-specific x.org patches.

The API breakage is in the x.org client library headers but also requires an ABI breakage in the entire x.org stack. Some distributions wish to take advantage of uTouch as it worked in Ubuntu 10.10 and the added functionality delivered by XI2.1 is not necessary for that.

This change makes the use of the API-breaking changes configurable at compile time for those downstream consumers who have been unable to build utouch-geis since version 2.0.4.

> And to clarify:
>
> Device will continue to work if XI2.1 is available and support for it is
> compiled, yes?

Functionality on Ubuntu will continue to work as before. Use of XI2.1 is enabled by default in development systems that support it unless steps are take to disable it with --disable-xi2.1 when running configure.

Revision history for this message
Stephen M. Webb (bregma) wrote :

> Are the two ways to test for the hidden attribute equivalent? If so, perhaps
> it should be saved for oneiric?

I'm not sure I understand this question. Do you mean utouch-geis should talk to the kernel of the host on which it's running to determine the capabilities of local hardware as an alternative to querying the X server if that choice is not available at compile time? That's possible as an add-on, but the changes in this merge would still be required.

This change is not targeted at Ubuntu. It does not need to get in to natty. It is for other downstream consumers of utouch-geis.

Revision history for this message
Henrik Rydberg (rydberg) wrote :

I was referring to lines 33-38 in the diff. Either way, since this is general development, no problem.

review: Approve
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good to me too!

review: Approve
Revision history for this message
Stephen M. Webb (bregma) wrote :

> I was referring to lines 33-38 in the diff. Either way, since this is general
> development, no problem.

Ah, I understand now.

AC_TRY_COMPILE is deprecated in autoconf in favour of AC_COMPILE_IFELSE. Since I was using the newer construct elsewhere I though I'd just go for consistency. The two compile tests are functionally equivalent in this case.

lp:~bregma/geis/lp-741404 updated
135. By Stephen M. Webb

Fix a persistence problem with callbacks in the simplified interface (LP: #754135).

136. By Stephen M. Webb

Make direct use of XI2,1 code optional at compile time (LP: #741404)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-04-05 18:04:36 +0000
3+++ ChangeLog 2011-04-13 01:55:45 +0000
4@@ -1,3 +1,11 @@
5+2011-04-12 Stephen M. Webb <stephen.webb@canonical.com>
6+
7+ Made direct use of XI2.1 optional at build time (LP: #741404).
8+
9+ * m4/ax_enable_xi2.m4: new autoconf macro
10+ * configure.ac: invoked the new macro
11+ * libutouch-geis/backend/xcb/geis_xcb_backend.c: optioned XI2.1 code
12+
13 2011-04-05 Stephen M. Webb <stephen.webb@canonical.com>
14
15 Fixed invalid pointer dereference on XI initialization failure in XCB back
16
17=== modified file 'configure.ac'
18--- configure.ac 2011-04-06 16:00:41 +0000
19+++ configure.ac 2011-04-13 01:55:45 +0000
20@@ -48,6 +48,8 @@
21 PKG_CHECK_MODULES([XI2], [xi >= 1.3], ,
22 AC_MSG_ERROR([XI2 development libraries not found]))
23
24+AX_ENABLE_XI2
25+
26 # XCB code generation configuration
27 PKG_CHECK_MODULES([XCB_PROTO], [xcb-proto >= 1.6])
28 AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
29@@ -66,8 +68,10 @@
30
31 # Check toolchain features
32 AC_MSG_CHECKING([whether hidden visibility is supported])
33-AC_TRY_COMPILE([void __attribute__((visibility ("hidden"))) bar (void) {}],,
34- [geis_hidden=yes],[geis_hidden=no])
35+geis_hidden=no
36+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
37+ void __attribute__((visibility ("hidden"))) bar (void) {}]),
38+ [geis_hidden=yes])
39 AC_MSG_RESULT($geis_hidden)
40 if test x$geis_hidden = xyes; then
41 AC_DEFINE([GEIS_DSO_PRIVATE],[1],[symbol visibility is supported])
42
43=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend.c'
44--- libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-04-06 15:16:00 +0000
45+++ libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-04-13 01:55:45 +0000
46@@ -112,6 +112,7 @@
47 GeisBoolean is_direct = GEIS_FALSE;
48 GeisBoolean is_independent = GEIS_FALSE;
49
50+#ifdef HAVE_XI_2_1
51 if (xi2_mode == XIDirectTouch)
52 is_direct = GEIS_TRUE;
53
54@@ -141,6 +142,7 @@
55 {
56 geis_device_add_attr(geis_device, device_attr);
57 }
58+#endif
59 }
60
61
62@@ -738,6 +740,7 @@
63 for (class_index = 0; class_index < xcb_device->num_classes; ++class_index)
64 {
65 XIAnyClassInfo *any = xcb_device->classes[class_index];
66+#ifdef HAVE_XI_2_1
67 if (any->type == XITouchClass)
68 {
69 XITouchClassInfo *v = (XITouchClassInfo *)any;
70@@ -807,6 +810,7 @@
71 geis_device_add_attr(geis_device, device_attr);
72 }
73 }
74+#endif
75 }
76 geis_post_event(be->geis, device_event);
77 goto final_exit;
78@@ -840,11 +844,13 @@
79 ++class_index)
80 {
81 XIAnyClassInfo *any = devices[device_index].classes[class_index];
82+#ifdef HAVE_XI_2_1
83 if (any->type == XITouchClass)
84 {
85 _report_an_xcb_device(be, &devices[device_index]);
86 break;
87 }
88+#endif
89 }
90 }
91
92
93=== added file 'm4/ax_enable_xi2.m4'
94--- m4/ax_enable_xi2.m4 1970-01-01 00:00:00 +0000
95+++ m4/ax_enable_xi2.m4 2011-04-13 01:55:45 +0000
96@@ -0,0 +1,36 @@
97+#
98+# @file m4/ac_enable_xi2.m4
99+# @brief autoconf macro to enable or disable support for XInput 2.1
100+#
101+# Copyright 2011 Canonical, Ltd.
102+#
103+# This file is part of the utouch-geis library. This library is free software;
104+# you can redistribute it and/or modify it under the terms of the GNU Lesser
105+# General Public License as published by the Free Software Foundation; either
106+# version 3 of the License, or (at your option) any later version.
107+#
108+# This library is distributed in the hope that it will be useful, but WITHOUT
109+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
110+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
111+# details.
112+#
113+# You should have received a copy of the GNU General Public License
114+# along with this program. If not, see <http://www.gnu.org/licenses/>.
115+#
116+AC_DEFUN([AX_ENABLE_XI2],[
117+ AC_ARG_ENABLE([xi2.1],
118+ AS_HELP_STRING([--disable-xi2.1], [Disable XI2.1 features]))
119+ AS_IF([test "x$enable_xi2_1" != "xno"],[
120+ AC_MSG_CHECKING([for XI2.1])
121+ ax_have_xi_2_1=no
122+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
123+ #include <X11/extensions/XInput2.h>
124+ XITouchValuatorClassInfo* p = 0;
125+ ]),
126+ [ax_have_xi_2_1=yes
127+ AC_DEFINE([HAVE_XI_2_1],[1],[XInput 2.1 is available])]
128+ )
129+ AC_MSG_RESULT([$ax_have_xi_2_1])
130+ ])
131+])
132+

Subscribers

People subscribed via source and target branches