diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-10 13:38:46 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-10 13:38:46 +1030 |
commit | 38bf01bd1c925614a6e67a38aa3cefc7b8fe3bca (patch) | |
tree | 9216fdf840d72611037d0806c482598941445d1e /hw/kdrive | |
parent | 4e85c7c322faf14c14e4229fa294b8e3d3a4d304 (diff) | |
parent | 0883e838e25227f0af84d2a90979175724166d16 (diff) |
Merge branch 'master' into mpx
Diffstat (limited to 'hw/kdrive')
-rw-r--r-- | hw/kdrive/ephyr/ephyr.c | 1 | ||||
-rw-r--r-- | hw/kdrive/src/kdrive.h | 5 | ||||
-rw-r--r-- | hw/kdrive/src/kinput.c | 12 |
3 files changed, 17 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 7df8651cb..21203a5e8 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -402,6 +402,7 @@ ephyrUnsetInternalDamage (ScreenPtr pScreen) pPixmap = (*pScreen->GetScreenPixmap) (pScreen); DamageUnregister (&pPixmap->drawable, scrpriv->pDamage); + DamageDestroy (scrpriv->pDamage); RemoveBlockAndWakeupHandlers (ephyrInternalDamageBlockHandler, ephyrInternalDamageWakeupHandler, diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 8722ba303..4e04b59f7 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -832,7 +832,10 @@ KdSetPointerMatrix (KdPointerMatrix *pointer); void KdComputePointerMatrix (KdPointerMatrix *pointer, Rotation randr, int width, int height); - + +void +KdScreenToPointerCoords (int *x, int *y); + void KdBlockHandler (int screen, pointer blockData, diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index e4cee6c42..c7c10e4e2 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -631,6 +631,18 @@ KdComputePointerMatrix (KdPointerMatrix *m, Rotation randr, int width, } } +void +KdScreenToPointerCoords (int *x, int *y) +{ + int (*m)[3] = kdPointerMatrix.matrix; + int div = m[0][1] * m[1][0] - m[1][1] * m[0][0]; + int sx = *x; + int sy = *y; + + *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div; + *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div; +} + static void KdKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl) { |