On Fri, May 25, 2007 at 02:23:59AM +0400, Anton Vorontsov wrote:
> On Thu, May 24, 2007 at 06:24:20PM +0400, kmeaw wrote:
> >  Shvetsov Alexey V. пишет:
> > > I use evtouch driver rather than tslib. It ocurred, that it handles 
> > > events 
> > > a bit differently: when you stop touching screen tslib ignores 
> > > information 
> > > about cursor position, but evtouch doesn't.
> > > The bug defenetely is in ts-adc-debounce  driver , but the same problem 
> > > can 
> > > be with other drivers. When you release pen, driver still sends 
> > > coordinates,
> > > of course they are not set, so (0, 0) is sent. As a result cursor is
> > > firstly moved to the left bottom corner of the screen and only then
> > > mouse button release event is generated. So you actually can't click on
> > > any button.
> > 
> >  Another version of patch, that reports last coordinates on release:
> > 
> >  Index: drivers/input/touchscreen/ts-adc-debounce.c
> >  ===================================================================
> >  RCS file: /cvs/linux/kernel26/drivers/input/touchscreen/ts-adc-debounce.c,v
> >  retrieving revision 1.43
> >  diff -d -u -r1.43 ts-adc-debounce.c
> >  --- drivers/input/touchscreen/ts-adc-debounce.c 4 Apr 2007 13:35:01 -0000  
> >   
> >      1.43
> >  +++ drivers/input/touchscreen/ts-adc-debounce.c 23 May 2007 16:12:07 -0000
> >  @@ -76,8 +76,12 @@
> >   {
> >  +       static int last_x, last_y;
> 
> ^^ statics not good here. think of multiple instances of
> ts-adc-debounce.
> 
> Plus, I still think that original patch is just okay.
> 
> It does not make any sense to send x/y when pen released. I.e. when pen
> *released* (past tense) x/y coordinates loosing any sense, we should not
> send them.
> 
> I'll give a try for original patch tomorrow... if it will not break
> anything I'll vote for it.

Ok, I've tried original patch* on h5000 and hx4700, and it does not break
anything (ts_test, Xfbdev using tslib). So, given that patch is sane,
trivial, and other touchscreen drivers seem doing the same, I voting for
it.

* Original patch somehow got corrupted on the way, and failed to apply.
Here is fixed version.


diff --git a/drivers/input/touchscreen/ts-adc-debounce.c 
b/drivers/input/touchscreen/ts-adc-debounce.c
index 257b9c5..2f2b81f 100644
--- a/drivers/input/touchscreen/ts-adc-debounce.c
+++ b/drivers/input/touchscreen/ts-adc-debounce.c
@@ -77,8 +77,10 @@ static void report_touchpanel(struct ts_adc *ts, int x, int 
y, int pressure)
 {
        input_report_key(ts->input, BTN_TOUCH, pressure != 0);
        input_report_abs(ts->input, ABS_PRESSURE, pressure);
-       input_report_abs(ts->input, ABS_X, x);
-       input_report_abs(ts->input, ABS_Y, y);
+       if (pressure) {
+               input_report_abs(ts->input, ABS_X, x);
+               input_report_abs(ts->input, ABS_Y, y);
+       }
        input_sync(ts->input);
 }
 
_______________________________________________
Hx4700-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/hx4700-port

Reply via email to