[RFC XI 2.1 - xf86-input-evdev 3/3] Use MTDev for multitouch devices

Chase Douglas chase.douglas at canonical.com
Fri Nov 19 08:02:08 PST 2010


On 11/19/2010 01:38 AM, Peter Hutterer wrote:
> On Fri, Nov 12, 2010 at 05:35:13PM -0500, Chase Douglas wrote:
>> From: Chase Douglas <chase.douglas at ubuntu.com>

[...]

>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index a5c89ac..89137bc 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -29,7 +29,7 @@ AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
>>  AM_CPPFLAGS =-I$(top_srcdir)/include
>>  
>>  @DRIVER_NAME at _drv_la_LTLIBRARIES = @DRIVER_NAME at _drv.la
>> - at DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
>> + at DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version $(MTDEV_LIBS)
>>  @DRIVER_NAME at _drv_ladir = @inputdir@
> 
> I think we should use LDADD for this?

I'll look into it.

>>  @DRIVER_NAME at _drv_la_SOURCES = @DRIVER_NAME at .c \
>> diff --git a/src/evdev.c b/src/evdev.c
>> index 8b13e9f..a83d4e4 100644
>> --- a/src/evdev.c
>> +++ b/src/evdev.c

[...]

>> @@ -2503,6 +2529,16 @@ EvdevOpenDevice(InputInfoPtr pInfo)
>>          }
>>      }
>>  
>> +#ifdef MULTITOUCH
>> +    if (mtdev_open(pEvdev->mtdev, pInfo->fd) == 0)
>> +        pEvdev->cur_slot = pEvdev->mtdev->caps.slot.value;
>> +    else {
>> +        free(pEvdev->mtdev);
>> +        pEvdev->mtdev = NULL;
>> +        xf86Msg(X_INFO, "%s: Couldn't open mtdev device\n", pInfo->name);
> 
> return FALSE here?

Originally, mtdev_open would fail if the device was not MT. In such a
scenario, you wouldn't want to bail out. However, now mtdev behaves as a
passthrough for non-MT devices, so returning FALSE here wouldn't be a
bad idea.

Thanks,

-- Chase


More information about the xorg-devel mailing list