# $Id: xorg-xf86_input_fujitouch_0.6.5_fujitsu_c.diff,v 1.1 2008/01/11 01:51:23 jcs Exp $ # # make the fujitouch driver work in current xorg since it no longer calls the # coordinate translation routine automatically. # # tested on a fujitsu lifebook p1610 # # by joshua stein # --- xf86-input-fujitouch-0.6.5/fujitsu.c Sat Jun 9 10:35:07 2007 +++ xf86-input-fujitouch-0.6.5.good/fujitsu.c Sun Dec 23 18:46:08 2007 @@ -484,6 +484,7 @@ static void FujiHandleCoordinate(LocalDevicePtr local) { FujiPrivatePtr priv = (FujiPrivatePtr)local->private; + int report_x, report_y; DBGOUT( 2, "%s\n", __FUNCTION__); priv->old_x = priv->cur_x; @@ -494,18 +495,21 @@ priv->cur_y = ((unsigned short)priv->packet[3]) | ( ((unsigned short)(priv->packet[4])) << 7 ); + ConvertProc(local, 0, 0, priv->cur_x, priv->cur_y, 0, 0, 0, 0, + &report_x, &report_y); + xf86XInputSetScreen(local, priv->screen_num, - priv->cur_x, - priv->cur_y); - + report_x, + report_y); + xf86PostProximityEvent(local->dev, 1, 0, 2, - priv->cur_x, - priv->cur_y); - + report_x, + report_y); - libtouchSetPos(priv->libtouch, priv->cur_x, priv->cur_y); - DBGOUT( 2, "setting (x/y)=(%d/%d)\n", - priv->cur_x, priv->cur_y); + libtouchSetPos(priv->libtouch, report_x, report_y); + + DBGOUT( 2, "setting x/y (%d/%d) to (%d/%d)\n", + priv->cur_x, priv->cur_y, report_x, report_y); /* * Send events. @@ -515,8 +519,8 @@ * emit a motion, regardless of the kind of packet processed. */ xf86PostMotionEvent (local->dev, TRUE, 0, 2, - priv->cur_x, - priv->cur_y); + report_x, + report_y); } @@ -603,6 +607,12 @@ int i = 0; #endif + /* XXX: these are normally set in xorg.conf, but they seem to then + * limit the converted coordinates by that much... not sure what is + * doing that, so just use them in the scope of this routine */ + int min_x = 113; + int min_y = 220; + FujiPrivatePtr priv = (FujiPrivatePtr) (local->private); ScrnInfoPtr pScrn = xf86Screens[priv->screen_num]; Rotation rotation = RRGetRotation(pScrn->pScreen); @@ -617,11 +627,11 @@ } if (!priv->calibrate) { - xc = v0 - priv->min_x; - yc = v1 - priv->min_y; + xc = v0 - min_x; + yc = v1 - min_y; - max_x = priv->max_x - priv->min_x; - max_y = priv->max_y - priv->min_y; + max_x = priv->max_x - min_x; + max_y = priv->max_y - min_y; if (priv->rotate == FUJI_ROTATE_NONE) { screen_width = priv->phys_width; @@ -732,7 +742,6 @@ DBGOUT(8, "dx=%f dy=%f\n", dx, dy); #endif - xc = ( ((float)xc / max_x) * screen_width ) + dx; yc = ( ((float)yc / max_y) * screen_height) + dy; @@ -920,7 +929,8 @@ priv->cur_y = (priv->max_y - priv->min_y) / 2; libtouchSetPos(priv->libtouch, priv->cur_x, priv->cur_y); - xf86AlwaysCore(local, TRUE); + /* XXX: no longer defined */ + /* xf86AlwaysCore(local, TRUE); */ priv->buffer = XisbNew (local->fd, 200); priv->packet_type = PACK_UNKNOWN;