From 4f364c19192e55bbaead59f747cb29cc5aeaee43 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 14 Jan 2008 10:50:54 +1030 Subject: [PATCH] Don't crash with xserver 1.4 xf86IsCorePointer() is gone. --- src/xf86Fpit.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c index 531b0bd..81d70a1 100644 --- a/src/xf86Fpit.c +++ b/src/xf86Fpit.c @@ -231,7 +231,7 @@ static void xf86FpitReadInput(LocalDevicePtr local) { FpitPrivatePtr priv = (FpitPrivatePtr) local->private; int len, loop; - int is_core_pointer; + int is_core_pointer = 1; int x, y, buttons, prox; DeviceIntPtr device; int conv_x, conv_y; @@ -319,7 +319,9 @@ static void xf86FpitReadInput(LocalDevicePtr local) prox = (priv->fpitData[loop] & PROXIMITY_BIT) ? 0 : 1; buttons = (priv->fpitData[loop] & BUTTON_BITS); device = local->dev; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 is_core_pointer = xf86IsCorePointer(device); +#endif xf86FpitConvert(local, 0, 2, x, y, 0, 0, 0, 0, &conv_x, &conv_y); xf86XInputSetScreen(local, priv->screen_no, conv_x, conv_y); -- 1.5.3 From d56b6396b00e451a1fa3cb0c47b4ba70b84873e0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 30 Jan 2008 13:30:59 +1030 Subject: [PATCH] Set is_core_pointer to 0 by default. Server 1.4 does not do physical core devices. --- src/xf86Fpit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c index 81d70a1..5b1d060 100644 --- a/src/xf86Fpit.c +++ b/src/xf86Fpit.c @@ -231,7 +231,7 @@ static void xf86FpitReadInput(LocalDevicePtr local) { FpitPrivatePtr priv = (FpitPrivatePtr) local->private; int len, loop; - int is_core_pointer = 1; + int is_core_pointer = 0; int x, y, buttons, prox; DeviceIntPtr device; int conv_x, conv_y; -- 1.5.3 From 81bde3c3952fec46ba43cec9b7cec478ee22641c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 30 Jan 2008 13:38:11 +1030 Subject: [PATCH] Use converted coordinates to post events. Until Bug #10324 is merged into the server, we have to scale in the driver and post screen coordinates up to the DDX. --- src/xf86Fpit.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c index 5b1d060..5c46809 100644 --- a/src/xf86Fpit.c +++ b/src/xf86Fpit.c @@ -329,10 +329,10 @@ static void xf86FpitReadInput(LocalDevicePtr local) /* coordinates are ready we can send events */ if (prox!=priv->fpitOldProximity) /* proximity changed */ - if (!is_core_pointer) xf86PostProximityEvent(device, prox, 0, 2, x, y); + if (!is_core_pointer) xf86PostProximityEvent(device, prox, 0, 2, conv_x, conv_y); if (priv->fpitOldX != x || priv->fpitOldY != y) /* position changed */ - xf86PostMotionEvent(device, 1, 0, 2, x, y); + xf86PostMotionEvent(device, 1, 0, 2, conv_x, conv_y); if (priv->fpitPassive) { /* @@ -359,7 +359,9 @@ static void xf86FpitReadInput(LocalDevicePtr local) int id; id = ffs(delta); delta &= ~(1 << (id - 1)); - xf86PostButtonEvent(device, 1, id, (buttons & (1 << (id - 1))), 0, 2, x, y); + xf86PostButtonEvent(device, 1, id, + (buttons & (1 << (id - 1))), + 0, 2, conv_x, conv_y); /* DBG(1, ErrorF("Button %d %s\n",id,(buttons & (1 << (id - 1)))?"DOWN":"UP"));*/ } priv->fpitOldButtons = buttons; -- 1.5.3