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
=== modified file 'ChangeLog'
--- ChangeLog 2011-04-05 18:04:36 +0000
+++ ChangeLog 2011-04-13 01:55:45 +0000
@@ -1,3 +1,11 @@
12011-04-12 Stephen M. Webb <stephen.webb@canonical.com>
2
3 Made direct use of XI2.1 optional at build time (LP: #741404).
4
5 * m4/ax_enable_xi2.m4: new autoconf macro
6 * configure.ac: invoked the new macro
7 * libutouch-geis/backend/xcb/geis_xcb_backend.c: optioned XI2.1 code
8
12011-04-05 Stephen M. Webb <stephen.webb@canonical.com>92011-04-05 Stephen M. Webb <stephen.webb@canonical.com>
210
3 Fixed invalid pointer dereference on XI initialization failure in XCB back11 Fixed invalid pointer dereference on XI initialization failure in XCB back
412
=== modified file 'configure.ac'
--- configure.ac 2011-04-06 16:00:41 +0000
+++ configure.ac 2011-04-13 01:55:45 +0000
@@ -48,6 +48,8 @@
48PKG_CHECK_MODULES([XI2], [xi >= 1.3], ,48PKG_CHECK_MODULES([XI2], [xi >= 1.3], ,
49 AC_MSG_ERROR([XI2 development libraries not found]))49 AC_MSG_ERROR([XI2 development libraries not found]))
5050
51AX_ENABLE_XI2
52
51# XCB code generation configuration53# XCB code generation configuration
52PKG_CHECK_MODULES([XCB_PROTO], [xcb-proto >= 1.6])54PKG_CHECK_MODULES([XCB_PROTO], [xcb-proto >= 1.6])
53AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)55AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
@@ -66,8 +68,10 @@
6668
67# Check toolchain features69# Check toolchain features
68AC_MSG_CHECKING([whether hidden visibility is supported])70AC_MSG_CHECKING([whether hidden visibility is supported])
69AC_TRY_COMPILE([void __attribute__((visibility ("hidden"))) bar (void) {}],,71geis_hidden=no
70 [geis_hidden=yes],[geis_hidden=no])72AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
73 void __attribute__((visibility ("hidden"))) bar (void) {}]),
74 [geis_hidden=yes])
71AC_MSG_RESULT($geis_hidden)75AC_MSG_RESULT($geis_hidden)
72if test x$geis_hidden = xyes; then76if test x$geis_hidden = xyes; then
73 AC_DEFINE([GEIS_DSO_PRIVATE],[1],[symbol visibility is supported])77 AC_DEFINE([GEIS_DSO_PRIVATE],[1],[symbol visibility is supported])
7478
=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend.c'
--- libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-04-06 15:16:00 +0000
+++ libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-04-13 01:55:45 +0000
@@ -112,6 +112,7 @@
112 GeisBoolean is_direct = GEIS_FALSE;112 GeisBoolean is_direct = GEIS_FALSE;
113 GeisBoolean is_independent = GEIS_FALSE;113 GeisBoolean is_independent = GEIS_FALSE;
114114
115#ifdef HAVE_XI_2_1
115 if (xi2_mode == XIDirectTouch)116 if (xi2_mode == XIDirectTouch)
116 is_direct = GEIS_TRUE;117 is_direct = GEIS_TRUE;
117118
@@ -141,6 +142,7 @@
141 {142 {
142 geis_device_add_attr(geis_device, device_attr);143 geis_device_add_attr(geis_device, device_attr);
143 }144 }
145#endif
144}146}
145147
146148
@@ -738,6 +740,7 @@
738 for (class_index = 0; class_index < xcb_device->num_classes; ++class_index)740 for (class_index = 0; class_index < xcb_device->num_classes; ++class_index)
739 {741 {
740 XIAnyClassInfo *any = xcb_device->classes[class_index];742 XIAnyClassInfo *any = xcb_device->classes[class_index];
743#ifdef HAVE_XI_2_1
741 if (any->type == XITouchClass)744 if (any->type == XITouchClass)
742 {745 {
743 XITouchClassInfo *v = (XITouchClassInfo *)any;746 XITouchClassInfo *v = (XITouchClassInfo *)any;
@@ -807,6 +810,7 @@
807 geis_device_add_attr(geis_device, device_attr);810 geis_device_add_attr(geis_device, device_attr);
808 }811 }
809 }812 }
813#endif
810 }814 }
811 geis_post_event(be->geis, device_event);815 geis_post_event(be->geis, device_event);
812 goto final_exit;816 goto final_exit;
@@ -840,11 +844,13 @@
840 ++class_index)844 ++class_index)
841 {845 {
842 XIAnyClassInfo *any = devices[device_index].classes[class_index];846 XIAnyClassInfo *any = devices[device_index].classes[class_index];
847#ifdef HAVE_XI_2_1
843 if (any->type == XITouchClass)848 if (any->type == XITouchClass)
844 {849 {
845 _report_an_xcb_device(be, &devices[device_index]);850 _report_an_xcb_device(be, &devices[device_index]);
846 break;851 break;
847 }852 }
853#endif
848 }854 }
849 }855 }
850856
851857
=== added file 'm4/ax_enable_xi2.m4'
--- m4/ax_enable_xi2.m4 1970-01-01 00:00:00 +0000
+++ m4/ax_enable_xi2.m4 2011-04-13 01:55:45 +0000
@@ -0,0 +1,36 @@
1#
2# @file m4/ac_enable_xi2.m4
3# @brief autoconf macro to enable or disable support for XInput 2.1
4#
5# Copyright 2011 Canonical, Ltd.
6#
7# This file is part of the utouch-geis library. This library is free software;
8# you can redistribute it and/or modify it under the terms of the GNU Lesser
9# General Public License as published by the Free Software Foundation; either
10# version 3 of the License, or (at your option) any later version.
11#
12# This library is distributed in the hope that it will be useful, but WITHOUT
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15# details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20AC_DEFUN([AX_ENABLE_XI2],[
21 AC_ARG_ENABLE([xi2.1],
22 AS_HELP_STRING([--disable-xi2.1], [Disable XI2.1 features]))
23 AS_IF([test "x$enable_xi2_1" != "xno"],[
24 AC_MSG_CHECKING([for XI2.1])
25 ax_have_xi_2_1=no
26 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
27 #include <X11/extensions/XInput2.h>
28 XITouchValuatorClassInfo* p = 0;
29 ]),
30 [ax_have_xi_2_1=yes
31 AC_DEFINE([HAVE_XI_2_1],[1],[XInput 2.1 is available])]
32 )
33 AC_MSG_RESULT([$ax_have_xi_2_1])
34 ])
35])
36

Subscribers

People subscribed via source and target branches