--- xf86Elo.c.orig 2008-03-20 11:55:34.000000000 -0700 +++ xf86Elo.c 2008-05-20 20:26:33.000000000 -0700 @@ -796,18 +796,23 @@ xf86EloReadInput(LocalDevicePtr local) int v3 = 0; /* not used in convert */ int v4 = 0; /* not used in convert */ int v5 = 0; /* not used in convert */ - int x; /* output */ - int y; /* output */ #endif DBG(4, ErrorF("Entering ReadInput\n")); /* * Try to get a packet. */ +#if GETPACKET_LOOP while (xf86EloGetPacket(priv->packet_buf, &priv->packet_buf_p, &priv->checksum, local->fd) == Success) { +#else + xf86EloGetPacket(priv->packet_buf, + &priv->packet_buf_p, + &priv->checksum, + local->fd); +#endif /* * Process only ELO_TOUCHs here. */ @@ -832,17 +837,17 @@ xf86EloReadInput(LocalDevicePtr local) * calib and before posting the event. */ - DBG(3, ErrorF("EloConvert Before Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, x, y)); + DBG(3, ErrorF("EloConvert Before Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); v0 = cur_x; /* based on the debug output this is what v0 is */ - v1 = cur_y; /* based on the debug output this is what v0 is */ + v1 = cur_y; /* based on the debug output this is what v1 is */ /* * Use the conversion method to send correct coordinates * since it contains all necessary logic */ - xf86EloConvert(local, first, num, v0, v1, v2, v3, v4, v5, &x, &y); - DBG(3, ErrorF("EloConvert During Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, x, y)); - xf86XInputSetScreen(local, priv->screen_no, x, y); - DBG(3, ErrorF("EloConvert After Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, x, y)); + xf86EloConvert(local, first, num, v0, v1, v2, v3, v4, v5, + &cur_x, &cur_y); + xf86XInputSetScreen(local, priv->screen_no, cur_x, cur_y); + DBG(3, ErrorF("EloConvert After Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); #endif /* @@ -852,20 +857,22 @@ xf86EloReadInput(LocalDevicePtr local) * location has changed as DIX assumes this. This is why we always * emit a motion, regardless of the kind of packet processed. */ - xf86PostMotionEvent(local->dev, TRUE, 0, 2, x, y); + xf86PostMotionEvent(local->dev, TRUE, 0, 2, cur_x, cur_y); /* * Emit a button press or release. */ if (state == ELO_PRESS || state == ELO_RELEASE) { - xf86PostButtonEvent(local->dev, TRUE, 1, state == ELO_PRESS, 0, 2, x, y); + xf86PostButtonEvent(local->dev, TRUE, 1, state == ELO_PRESS, 0, 2, cur_x, cur_y); } DBG(3, ErrorF("TouchScreen: x(%d), y(%d), %s\n", cur_x, cur_y, (state == ELO_PRESS) ? "Press" : ((state == ELO_RELEASE) ? "Release" : "Stream"))); } +#if GETPACKET_LOOP } +#endif }