Search
SailfishOS Open Build Service
>
Projects
>
home:wonko
:
archos-g9-pa-adaptation
:
pvr
>
xorg-x11-drv-mtev
> rotation.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File rotation.patch of Package xorg-x11-drv-mtev
diff -ru xorg-x11-drv-mtev-0.1.13/src/mtouch.h xorg-x11-drv-mtev-0.1.13-rotation/src/mtouch.h --- xorg-x11-drv-mtev-0.1.13/src/mtouch.h 2012-11-21 16:01:35.286578579 +0000 +++ xorg-x11-drv-mtev-0.1.13-rotation/src/mtouch.h 2012-11-21 16:00:48.106974820 +0000 @@ -70,6 +70,7 @@ bool invert_y; bool swap_xy; struct mtdev dev; + int rotation; int min_x; int max_x; Only in xorg-x11-drv-mtev-0.1.13-rotation/src: mtouch.h.orig Only in xorg-x11-drv-mtev-0.1.13-rotation/src: mtouch.h.rej diff -ru xorg-x11-drv-mtev-0.1.13/src/multitouch.c xorg-x11-drv-mtev-0.1.13-rotation/src/multitouch.c --- xorg-x11-drv-mtev-0.1.13/src/multitouch.c 2012-11-21 16:01:35.287578571 +0000 +++ xorg-x11-drv-mtev-0.1.13-rotation/src/multitouch.c 2012-11-21 16:14:26.208104812 +0000 @@ -306,6 +306,30 @@ if (mt->invert_y) y = mt->max_y - y + mt->min_y; + switch (mt->rotation) + { + case 1: + { + const int tmp = (mt->max_x - x) * (mt->max_y - mt->min_y) / (mt->max_x - mt->min_x) + mt->min_y; + x = (y - mt->min_y) * (mt->max_x - mt->min_x) / (mt->max_y - mt->min_y) + mt->min_x; + y = tmp; + break; + } + case 2: + { + x = mt->max_x - x + mt->min_x; + y = mt->max_y - y + mt->min_y; + break; + } + case 3: + { + const int tmp = (x - mt->min_x) * (mt->max_y - mt->min_y) / (mt->max_x - mt->min_x) + mt->min_y; + x = (mt->max_y - y) * (mt->max_x - mt->min_x) / (mt->max_y - mt->min_y) + mt->min_x; + y = tmp; + break; + } + } + valuators[valix++] = x; valuators[valix++] = y; valuators[valix++] = tp->touch_major; @@ -401,6 +425,15 @@ mt->invert_x = xf86SetBoolOption(local->options, "InvertX", FALSE); mt->invert_y = xf86SetBoolOption(local->options, "InvertY", FALSE); + // o = 0 + // 1 = CW 90 + // 2 = CW 180 + // 3 = CW 270 + mt->rotation = xf86SetIntOption(local->options, "Rotation", 0); + + if (mt->rotation < 0 || mt->rotation > 3) + mt->rotation = 0; + local->flags |= XI86_CONFIGURED; return Success;