Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 2014 07:46:30 +0100
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        huanghwh@gmail.com
Cc:        "kwm@freebsd.org" <kwm@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, "freebsd-usb@freebsd.org" <freebsd-usb@freebsd.org>
Subject:   Re: Apple Trackpad driver
Message-ID:  <52E9F546.9090005@bitfrost.no>
In-Reply-To: <CAB8uncZVCbFWhJrEosRtRebRip4HjArsZx9FwKE0q9EjYDncmg@mail.gmail.com>
References:  <CAB8uncaLEn4CaJv8%2BowESe_zUUK%2Bgem_bXpEjhsOJE69m_fWAg@mail.gmail.com> <CAJ-Vmon4Gk6bqoT%2BJf-bRxE0%2BNJ1NjR0wjum-HjoVFDN-2e=8Q@mail.gmail.com> <CAASDrV=pbDpZCGvEjnD8VS0D_HyC8=L3jQ7rfGszG6=PtxaE3Q@mail.gmail.com> <CAASDrVmqijq51OEH7USLutPSgme7YWhXZZX4tGROLHVPoz2VkA@mail.gmail.com> <52E8DDA3.3070301@bitfrost.no> <CAB8uncZVCbFWhJrEosRtRebRip4HjArsZx9FwKE0q9EjYDncmg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Huang,

On 01/30/14 06:56, Huang Wen Hui wrote:
> Hans,
>
> Thanks for you take care of it and commit it! I found two problems:
>
> 1. The selection is not expected when selection with 2 fingers sometimes.
> 2.  Unexpected scrolling when Click with 2 fingers.
>
> This patch can fix that. The var "n" modify to "ntouch"  seems to be
> necessary.
>

Right, but aren't we then accessing non-initialised sc->pos_x[] data ?

Because if ntouch == 2, n can be less than or equal to 2, due to 
continue in for-loop above. What is the purpose of the "n" variable?

Can you explain?

-		if (n == 2) {
+		if (ntouch == 2) {
  			sc->distance = max(sc->distance, max(
  			    abs(sc->pos_x[0] - sc->pos_x[1]),
  			    abs(sc->pos_y[0] - sc->pos_y[1])));

--HPS

>
> Cheers,
> Huang Wen Hui
>
>
> 2014-01-29 Hans Petter Selasky <hps@bitfrost.no>
>
>> On 01/29/14 09:49, Lundberg, Johannes wrote:
>>
>>> Hi
>>>
>>> I tested the driver on a 2012 Macbook Air 11" and it works great! Good
>>> job!
>>>
>>> Is there a way to disable click-by-touch? I always preferred clicking with
>>> the physical button that is built in to the pad.
>>>
>>>
>> Hi,
>>
>> I've added an "#if 0" around the 1 finger tap code until further. Maybe
>> this feature can be tunable?
>>
>> I fixed the code style, added some range checks and cleared some buffer
>> issues.
>>
>> When you assign a signed value to an unsigned variable, you should range
>> check it, because the sign might cause an overflow when you use it later on.
>>
>> int8_t x = -1;
>>
>> uint32_t t = x;
>>
>> "t" is now "0xffffffffU" and not "255".
>>
>> Tested the code on my MacBookPro. Hope I didn't break anything. If so,
>> send a patch to freebsd-usb.
>>
>> http://svnweb.freebsd.org/changeset/base/261260
>>
>> To get the touchpad working with Xorg, I needed to re-compile HALD with
>> the attached patch.
>>
>> kwm: Can you get the attached patch into ports?
>>
>> Auto-loading of wsp via devd will be done later. Simply need to
>> re-generate usb.conf in /etc ...
>>
>> --HPS
>>
>>
>>
>>
>> _______________________________________________
>> freebsd-current@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-current
>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52E9F546.9090005>