reverted: --- xf86-input-evtouch-0.8.7/evtouch.c +++ xf86-input-evtouch-0.8.7.orig/evtouch.c @@ -301,16 +301,6 @@ libtouchSetYPos(priv->libtouch, priv->cur_y); } - if (ev->code == ABS_Z) { - priv->cur_x = ev->value; - libtouchSetXPos(priv->libtouch, priv->cur_x); - } - - if (ev->code == ABS_RX) { - priv->cur_y = ev->value; - libtouchSetYPos(priv->libtouch, priv->cur_y); - } - if (ev->code == ABS_WHEEL) { LocalDevicePtr local = priv->local; diff -u xf86-input-evtouch-0.8.7/debian/xsfbs/xsfbs.mk xf86-input-evtouch-0.8.7/debian/xsfbs/xsfbs.mk --- xf86-input-evtouch-0.8.7/debian/xsfbs/xsfbs.mk +++ xf86-input-evtouch-0.8.7/debian/xsfbs/xsfbs.mk @@ -196,7 +196,6 @@ rm -rf $(STAMP_DIR) $(SOURCE_DIR) rm -rf imports dh_clean debian/shlibs.local \ - debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new \ debian/po/pothead # Generate the debconf templates POT file header. @@ -209,58 +208,6 @@ updatepo: debian/po/pothead debian/scripts/debconf-updatepo --pot-header=pothead --verbose -# Use the MANIFEST files to determine whether we're shipping everything we -# expect to ship, and not shipping anything we don't expect to ship. -.PHONY: check-manifest -stampdir_targets+=check-manifest -check-manifest: $(STAMP_DIR)/check-manifest -$(STAMP_DIR)/check-manifest: $(STAMP_DIR)/install - # Compare manifests. - (cd debian/tmp && find -type f | LC_ALL=C sort | cut -c3-) \ - >debian/MANIFEST.$(ARCH).new - # Construct MANIFEST files from MANIFEST.$(ARCH).in and - # MANIFEST.$(ARCH).all or MANIFEST.all. - if expr "$(findstring -DBuildFonts=NO,$(IMAKE_DEFINES))" \ - : "-DBuildFonts=NO" >/dev/null 2>&1; then \ - LC_ALL=C sort -u debian/MANIFEST.$(ARCH).in >debian/MANIFEST.$(ARCH); \ - else \ - if [ -e debian/MANIFEST.$(ARCH).all ]; then \ - LC_ALL=C sort -u debian/MANIFEST.$(ARCH).in debian/MANIFEST.$(ARCH).all >debian/MANIFEST.$(ARCH); \ - else \ - LC_ALL=C sort -u debian/MANIFEST.$(ARCH).in debian/MANIFEST.all >debian/MANIFEST.$(ARCH); \ - fi; \ - fi - # Confirm that the installed file list has not changed. - if [ -e debian/MANIFEST.$(ARCH) ]; then \ - if ! cmp -s debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new; then \ - diff -U 0 debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new || DIFFSTATUS=$$?; \ - case $${DIFFSTATUS:-0} in \ - 0) ;; \ - 1) if [ -n "$$IGNORE_MANIFEST_CHANGES" ]; then \ - echo 'MANIFEST check failed; ignoring problem because \$$IGNORE_MANIFEST_CHANGES set' >&2; \ - echo 'Please ensure that the package maintainer has an up-to-date version of the' >&2; \ - echo 'MANIFEST.$(ARCH).in file.' >&2; \ - else \ - echo 'MANIFEST check failed; please see debian/README' >&2; \ - exit 1; \ - fi; \ - ;; \ - *) echo "diff reported unexpected exit status $$DIFFSTATUS when performing MANIFEST check" >&2; \ - exit 1; \ - ;; \ - esac; \ - fi; \ - fi - >$@ - -# Because we build (and install) different files depending on whether or not -# any architecture-independent packages are being created, the list of files we -# expect to see will differ; see the discussion of the "build" target above. -.PHONY: check-manifest-arch check-manifest-indep -check-manifest-arch: IMAKE_DEFINES+= -DBuildSpecsDocs=NO -DBuildFonts=NO -DInstallHardcopyDocs=NO -check-manifest-arch: check-manifest -check-manifest-indep: check-manifest - # Remove files from the upstream source tree that we don't need, or which have # licensing problems. It must be run before creating the .orig.tar.gz. # @@ -272,29 +219,6 @@ dh_testdir grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf -# Change to what should be the correct directory, ensure it is, and if -# so, create the .orig.tar.gz file. Exclude the debian directory and its -# contents, and any .svn directories and their contents (so that we can safely -# build an .orig.tar.gz from SVN checkout, not just an export). -# -# Note: This rule is for Debian package maintainers' convenience, and is not -# needed for conventional build scenarios. -# -# This rule *IS* the recommended method for creating a new .orig.tar.gz file, -# for the rare situations when one is needed. -.PHONY: make-orig-tar-gz -make-orig-tar-gz: clean prune-upstream-tree - ( cd .. \ - && if [ $(shell basename $(CURDIR)) != $(SOURCE_NAME)-$(NO_EPOCH_VER) ]; then \ - echo "Our current working directory has the wrong name. Renaming..." >&2; \ - mv $(CURDIR) $(SOURCE_NAME)-$(NO_EPOCH_VER); \ - fi; \ - tar --exclude=debian --exclude=debian/* \ - --exclude=.svn --exclude=.svn/* \ - -cf - $(SOURCE_NAME)-$(NO_EPOCH_VER) \ - | gzip -9 >$(SOURCE_NAME)_$(NO_EPOCH_VER).orig.tar.gz; \ - ) - # Verify that there are no offsets or fuzz in the patches we apply. # # Note: This rule is for Debian package maintainers' convenience, and is not diff -u xf86-input-evtouch-0.8.7/debian/control xf86-input-evtouch-0.8.7/debian/control --- xf86-input-evtouch-0.8.7/debian/control +++ xf86-input-evtouch-0.8.7/debian/control @@ -5,9 +5,10 @@ XSBC-Original-Maintainer: Debian X Strike Force Uploaders: Mattia Dongili Build-Depends: debhelper (>= 5), pkg-config, xserver-xorg-dev (>= 2:1.4), x11proto-randr-dev, libxrender-dev, libx11-dev, quilt -Standards-Version: 3.7.2 -XS-Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-input-evtouch -XS-Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-input-evtouch.git +Standards-Version: 3.7.3 +Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-input-evtouch +Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-input-evtouch.git +Homepage: http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html Package: xserver-xorg-input-evtouch Architecture: any @@ -20,3 +21,2 @@ . - Homepage: http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html diff -u xf86-input-evtouch-0.8.7/debian/patches/series xf86-input-evtouch-0.8.7/debian/patches/series --- xf86-input-evtouch-0.8.7/debian/patches/series +++ xf86-input-evtouch-0.8.7/debian/patches/series @@ -4 +4,3 @@ -05_build_with_1_4.patch +#05_build_with_1_4.patch +06_xf86-input-evtouch-0.8.7-misc.patch +07_random_fixes_for_06.patch diff -u xf86-input-evtouch-0.8.7/debian/changelog xf86-input-evtouch-0.8.7/debian/changelog --- xf86-input-evtouch-0.8.7/debian/changelog +++ xf86-input-evtouch-0.8.7/debian/changelog @@ -1,3 +1,23 @@ +xf86-input-evtouch (0.8.7-3ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: (LP: #190004) + - Change maintainer address. + - Change the default font from helvetica to fixed. + * Drop Pepper/Q1 patch, upstream has a slightly different fix + * Upstream includes fix for running on amd64 (LP: #155880) + + -- Steve Magoun Thu, 07 Feb 2008 14:09:00 -0500 + +xf86-input-evtouch (0.8.7-3) unstable; urgency=low + + * work(!!!!) with xserver-xorg-core 1.4 + * added xf86-input-evtouch-0.8.7-misc.patch from + http://www.postnuklear.de/xorg-patches/ (Closes: #443726) + * bump Standards-Version to 3.7.3 + * use Vcs and Homepage headers in debian/control + + -- Mattia Dongili Sat, 02 Feb 2008 21:32:15 +0900 + xf86-input-evtouch (0.8.7-2ubuntu1) hardy; urgency=low * Merge from debian unstable, remaining changes: only in patch2: unchanged: --- xf86-input-evtouch-0.8.7.orig/debian/patches/06_xf86-input-evtouch-0.8.7-misc.patch +++ xf86-input-evtouch-0.8.7/debian/patches/06_xf86-input-evtouch-0.8.7-misc.patch @@ -0,0 +1,770 @@ +# +# This patch is from http://www.postnuklear.de/xorg-patches/ +# +# Description: This is a patch for the evtouch input driver ( +# http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html). +# Changes (for full description see ChangeLog file after patching (-: ): +# o Changed code to compile a working driver for both XInput ABI 0.x and 2.0 (Xorg 1.4.0) +# o changed rotation (due to segfault on xorg + fbdev) +# o drag support +# o tap "tolerance" +# o added generic ts-adc touchscreen device to udev rules file +# +# Feel free to send comments, critics, suggestions to harryrat@postnuklear.de +# To apply simply change into the toplevel directory of the source to be modified and enter: +# patch -p1 < +# +# All patches are available under the GNU GPL, I hope they might be useful for you (-: +# - Harald Radke +# +Index: xserver-xorg-input-evtouch/69-touchscreen.rules +=================================================================== +--- xserver-xorg-input-evtouch.orig/69-touchscreen.rules 2008-02-02 21:49:20.783972805 +0900 ++++ xserver-xorg-input-evtouch/69-touchscreen.rules 2008-02-02 21:49:39.730979724 +0900 +@@ -7,8 +7,11 @@ + # Name can be found in /proc/bus/input/devices ('cat /proc/bus/input/devices') + # + +-# These are the touchscreens supported by kernel's "usbtouchscreen" module ++# Generic ts-adc touchscreen modules ++KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="ts-adc", SYMLINK+="input/evtouch_event" ++ + ++# These are the touchscreens supported by kernel's "usbtouchscreen" module + # eGalax Inc. USB TouchController) + KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="3823", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" + # eGalax Inc. USB TouchController) +Index: xserver-xorg-input-evtouch/ChangeLog +=================================================================== +--- xserver-xorg-input-evtouch.orig/ChangeLog 2008-02-02 21:49:20.795972782 +0900 ++++ xserver-xorg-input-evtouch/ChangeLog 2008-02-02 21:49:39.730979724 +0900 +@@ -1,3 +1,61 @@ ++0.8.7-HR *** Note this is not an official release but an "unauthorized ++ *** fix version by me (Harald Radke - harryrat@postnuklear.de) ++ -> Changed code to compile a working driver for both ++ XInput ABI 0.x and 2.0 (Xorg 1.4.0) ++ (test compile for 0.x still needs to be done) ++ - evtouch.c: ++ * capsulated xf86Post*Events and xf86InputSetScreen ++ in functions where depending on the XINPUT ABI conversion ++ is done or xf86 functions are directly called ++ * xf86InitValuatorAxisStruct and xf86AlwaysCore() depending ++ on ABI done ++ - libtouch.h: passing xf86PostButtonEvent capsulation function ++ to init function (same as in evtouch.c) to do proper button ++ triggering ++ -> Rotation: ++ - added support for Option "Rotate" "UD" (upside down) ++ in evtouch input section of xorg.conf ++ - due to Segfault with (at least) fbdev video device, only ++ evtouch "Rotate" option is taken into calculations for coords, ++ meaning to get proper touchscreen behaviour on rotated X screens. ++ same Rotate option as in video device section of xorg.conf has ++ to be set in the evtouch section ++ -> Drag support: ++ Option "_drag" "" has been added. When set, ++ the handle_() function triggers BUTTON_DOWN for Button ++ before changing into S_MOVE state. Note that actually only ++ Option "touched_drag" "" is implemented, rest is dummy ++ (and doesn't make too much sense I guess) (-; ++ -> tap "tolerance": ++ introduce move_limit to evtouch.c as it is in libtouch.c, using it ++ to discard ABS_X/Y position changes if they are inside move_limit ++ around cur_x/y. this way pointer hopping can be avoided as well as ++ proper touched_drag established ++ - changes of cur_x/y are reported on EV_SYN in evtouch.c ReadInput() instead ++ on EV_ABS ++ -> added generic ts-adc touchscreen device to udev rules file ++ ++ => Example for a Loox720 PDA setup in input section of xorg.conf: ++ Section "InputDevice" ++ Identifier "touchscreen" ++ Driver "evtouch" ++ Option "Device" "/dev/input/evtouch_event" ++ Option "MinX" "434" ++ Option "MinY" "333" ++ Option "MaxX" "3643" ++ Option "MaxY" "3804" ++ Option "SwapX" "true" ++ Option "longtouched_action" "down" ++ Option "longtouched_button" "3" ++ Option "maybetapped_action" "click" ++ Option "maybetapped_button" "1" ++ Option "touched_drag" "1" ++ Option "oneandahalftap_button" "0" ++ Option "TapTimer" "30" ++ Option "LongtouchTimer" "500" ++ Option "MoveLimit" "18" ++ EndSection ++ + 0.8.7 + - Added Elo Touchscreen to udev-rules (Stephen Webb) + - Added "fix" for AMD64-crashes on touch (Martin Letenay) +Index: xserver-xorg-input-evtouch/evtouch.c +=================================================================== +--- xserver-xorg-input-evtouch.orig/evtouch.c 2008-02-02 21:49:20.811973497 +0900 ++++ xserver-xorg-input-evtouch/evtouch.c 2008-02-02 21:49:39.734971242 +0900 +@@ -182,6 +182,20 @@ static const char *default_options[] = + static int + ControlProc(LocalDevicePtr device, xDeviceCtl *ctrl); + ++static void ++PostMotionEvent(LocalDevicePtr local); ++ ++static void ++PostProximityEvent(LocalDevicePtr local,int is_in); ++ ++static void ++PostButtonEvent(LocalDevicePtr local, int button, ++ int is_down, int x,int y); ++ ++static void ++InputSetScreen(LocalDevicePtr local); ++ ++ + /***************************************************************************** + * Function Definitions + ****************************************************************************/ +@@ -197,11 +211,10 @@ emulate3Timer(OsTimerPtr timer, CARD32 n + LocalDevicePtr local = (LocalDevicePtr)_local; + EVTouchPrivatePtr priv = (EVTouchPrivatePtr) local->private; + ++ + sigstate = xf86BlockSIGIO(); + +- xf86PostMotionEvent(local->dev, TRUE, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostMotionEvent(local); + + /* + * Emit a button press -- release is handled in EVTouchLBRBEvent +@@ -209,31 +222,21 @@ emulate3Timer(OsTimerPtr timer, CARD32 n + if ( ( priv->touch_flags & LB_STAT ) && + !( priv->touch_flags & RB_STAT ) ) { + DBGOUT(2, "EVTouch: Left Press\n"); +- xf86PostButtonEvent (local->dev, TRUE, +- 1, 1, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostButtonEvent (local, 1, 1,priv->cur_x,priv->cur_y); + } + + if ( ( priv->touch_flags & RB_STAT ) && + !( priv->touch_flags & LB_STAT ) ) { + DBGOUT(2, "EVTouch: Right Press\n"); +- xf86PostButtonEvent (local->dev, TRUE, +- 3, 1, 0, 2, +- priv->cur_x, +- priv->cur_y); +- } +- ++ PostButtonEvent (local, 3, 1,priv->cur_x,priv->cur_y); ++ } + /* + Handling "middle" button press + */ + if ( ( priv->touch_flags & RB_STAT ) && + ( priv->touch_flags & LB_STAT ) ) { + DBGOUT(2, "EVTouch: Middle Press\n"); +- xf86PostButtonEvent (local->dev, TRUE, +- 2, 1, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostButtonEvent (local, 2, 1,priv->cur_x,priv->cur_y); + } + + priv->emulate3_timer_expired = TRUE; +@@ -246,6 +249,7 @@ static void DoBtnAction(EVTouchPrivatePt + { + int btn = 0; + LocalDevicePtr local = priv->local; ++ + DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, priv->btn_count); + + for (btn = 0; btn < priv->btn_count; btn++) { +@@ -262,12 +266,7 @@ static void DoBtnAction(EVTouchPrivatePt + DBGOUT(2, "EVTouch: %s btn = %d action = %d\n", + __FUNCTION__, btn, + priv->btn_actions[btn].action); +- +- xf86PostButtonEvent (local->dev, TRUE, btn, +- priv->btn_actions[btn].action, +- 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostButtonEvent (local, btn, priv->btn_actions[btn].action,priv->cur_x,priv->cur_y); + + priv->btn_actions[btn].do_it = 0; + priv->btn_actions[btn].action = 0; +@@ -292,39 +291,32 @@ void EVTouchProcessAbs(EVTouchPrivatePtr + ev = &priv->ev; + + if ( (ev->code == ABS_X) || (ev->code == ABS_Z) ) { ++ if ((priv->cur_x - ev->value < priv->move_limit) ++ && (priv->cur_x - ev->value > -priv->move_limit)) ++ return; + priv->cur_x = ev->value; +- libtouchSetXPos(priv->libtouch, priv->cur_x); ++// libtouchSetXPos(priv->libtouch, priv->cur_x); + } + + if ( (ev->code == ABS_Y) || (ev->code == ABS_RX) ) { ++ if ((priv->cur_y - ev->value < priv->move_limit) ++ && (priv->cur_y - ev->value > -priv->move_limit)) ++ return; + priv->cur_y = ev->value; +- libtouchSetYPos(priv->libtouch, priv->cur_y); ++// libtouchSetYPos(priv->libtouch, priv->cur_y); + } + + if (ev->code == ABS_WHEEL) { + LocalDevicePtr local = priv->local; +- + if (ev->value > 0) { + for (; ev->value > 0; ev->value--) { +- xf86PostButtonEvent (local->dev, TRUE, +- 4, 1, 0, 2, +- priv->cur_x, +- priv->cur_y); +- xf86PostButtonEvent (local->dev, TRUE, +- 4, 0, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostButtonEvent (local, 4,1,priv->cur_x,priv->cur_y); ++ PostButtonEvent (local, 4,0,priv->cur_x,priv->cur_y); + } + } else if (ev->value < 0) { + for (ev->value = -ev->value; ev->value > 0; ev->value--) { +- xf86PostButtonEvent (local->dev, TRUE, +- 5, 1, 0, 2, +- priv->cur_x, +- priv->cur_y); +- xf86PostButtonEvent (local->dev, TRUE, +- 5, 0, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostButtonEvent (local, 5,1,priv->cur_x,priv->cur_y); ++ PostButtonEvent (local, 5,0,priv->cur_x,priv->cur_y); + } + } + } +@@ -451,10 +443,7 @@ void EVTouchProcessKey(EVTouchPrivatePtr + default: + return; + } +- xf86PostButtonEvent(local->dev, TRUE, +- btn, ev->value, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostButtonEvent (local, btn, ev->value,priv->cur_x,priv->cur_y); + #endif + + return; +@@ -492,8 +481,8 @@ DeviceOn (DeviceIntPtr dev) + + priv->buffer = XisbNew(local->fd, 64); + +- DBG (9, XisbTrace (priv->buffer, 1)); +- ++// breaks compilation ++// DBG (9, XisbTrace (priv->buffer, 1)); + + if (!priv->buffer) + { +@@ -637,8 +626,19 @@ DeviceInit (DeviceIntPtr dev) + ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n"); + return !Success; + } +- +- xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x, ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2 ++ xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width, ++ 1024, ++ EV_AXIS_MIN_RES /* min_res */ , ++ EV_AXIS_MAX_RES /* max_res */ ); ++ xf86InitValuatorDefaults(dev, 0); ++ xf86InitValuatorAxisStruct(dev, 1, 0, priv->screen_height, ++ 1024, ++ EV_AXIS_MIN_RES /* min_res */ , ++ EV_AXIS_MAX_RES /* max_res */ ); ++ xf86InitValuatorDefaults(dev, 1); ++#else ++ xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x, + 1024, + EV_AXIS_MIN_RES /* min_res */ , + EV_AXIS_MAX_RES /* max_res */ ); +@@ -648,7 +648,7 @@ DeviceInit (DeviceIntPtr dev) + EV_AXIS_MIN_RES /* min_res */ , + EV_AXIS_MAX_RES /* max_res */ ); + xf86InitValuatorDefaults(dev, 1); +- ++#endif + /* Initial position of pointer on screen: Centered */ + priv->cur_x=(priv->max_x - priv->min_x)/2; + priv->cur_y=(priv->max_y - priv->min_y)/2; +@@ -777,14 +777,8 @@ static void ReadInput (LocalDevicePtr lo + DBGOUT(2, "EVTouch: %s type:%0.2x code: 0x%0.4x value:%d\n", + __FUNCTION__, ev->type, ev->code, ev->value); + +- xf86XInputSetScreen(local, +- priv->screen_num, +- priv->cur_x, +- priv->cur_y); +- +- xf86PostProximityEvent(local->dev, 1, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ InputSetScreen(local); ++ PostProximityEvent (local,1); + + switch (ev->type) { + case EV_ABS: +@@ -794,9 +788,7 @@ static void ReadInput (LocalDevicePtr lo + EVTouchProcessRel(priv); + break; + case EV_KEY: +- xf86PostMotionEvent (local->dev, TRUE, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ PostMotionEvent (local); + + if (priv->ev.code == BTN_TOUCH) { + if (priv->ev.value == 1) { +@@ -811,9 +803,8 @@ static void ReadInput (LocalDevicePtr lo + EVTouchProcessKey(priv); + break; + case EV_SYN: +- xf86PostMotionEvent (local->dev, TRUE, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ libtouchSetPos(priv->libtouch, priv->cur_x,priv->cur_y); ++ PostMotionEvent (local); + + if ( priv->touch_flags & TOUCHED ) + libtouchTriggerSM(priv->libtouch, PEN_TOUCHED); +@@ -902,7 +893,9 @@ ConvertProc ( LocalDevicePtr local, + + EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); + ScrnInfoPtr pScrn = xf86Screens[priv->screen_num]; +- Rotation rotation = RRGetRotation(pScrn->pScreen); ++ ++// X Segfaults ++// Rotation rotation = RRGetRotation(pScrn->pScreen); + + DBGOUT(2, "EVTouch: FIRST: v0=%d v1=%d\n", v0, v1); + +@@ -921,15 +914,17 @@ ConvertProc ( LocalDevicePtr local, + max_x = priv->max_x - priv->min_x; + max_y = priv->max_y - priv->min_y; + +- if (priv->rotate == EV_ROTATE_NONE) { ++ ++// if (priv->rotate == EV_ROTATE_NONE) { + screen_width = pScrn->currentMode->HDisplay; + screen_height = pScrn->currentMode->VDisplay; ++/* Swapping is done below in Coords! Leave those to be able to calc correct mapping + } else { + screen_width = pScrn->currentMode->VDisplay; + screen_height = pScrn->currentMode->HDisplay; + } + +- ++*/ + if (xc < (max_x / 2)) { + /* + left +@@ -1042,45 +1037,57 @@ ConvertProc ( LocalDevicePtr local, + + int tmp = 0; + /* rotation mixes x and y up a bit */ +- if (priv->rotate == EV_ROTATE_CW) { ++ switch(priv->rotate) { ++ case EV_ROTATE_CW: + tmp = xc; + xc = yc; + yc = screen_width - tmp; +- } else if (priv->rotate == EV_ROTATE_CCW) { ++ break; ++ case EV_ROTATE_CCW: + tmp = xc; + xc = screen_height - yc; + yc = tmp; ++ break; ++ case EV_ROTATE_UD: ++ xc = screen_width - xc; ++ yc = screen_height - yc; ++ break; ++ default: ++ break; + } + +- switch (rotation) { +- case RR_Rotate_0: ++/* X Segfaults on rotation setting ++ switch (rotation) { ++ case RR_Rotate_0: + v0 = xc; + v1 = yc; +- break; +- case RR_Rotate_180: +- v0 = screen_width - xc; +- v1 = screen_height - yc; +- break; +- case RR_Rotate_90: ++ break; ++ case RR_Rotate_180: ++ v0 = screen_width - xc; ++ v1 = screen_height - yc; ++ break; ++ case RR_Rotate_90: + tmp = xc; +- v0 = screen_height - yc; ++ v0 = screen_height - yc; + v1 = tmp; +- break; +- case RR_Rotate_270: ++ break; ++ case RR_Rotate_270: + tmp = xc; +- v0 = yc; +- v1 = screen_width - tmp; +- break; +- default: +- break; +- } ++ v0 = yc; ++ v1 = screen_width - tmp; ++ break; ++ default: ++ break; ++ } ++ ++ ++*/ + } + + DBGOUT(2, "EVTouch: FINAL: v0=%d v1=%d\n", v0, v1); + +- *x = v0; +- *y = v1; +- ++ *x = xc; ++ *y = yc; + return (TRUE); + } + +@@ -1133,8 +1140,9 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + + xf86OptionListReport(local->options); + ++ + priv->libtouch = xcalloc(1, sizeof(LibTouchRec)); +- libtouchInit(priv->libtouch, local); ++ libtouchInit(priv->libtouch, local,PostButtonEvent); + + priv->screen_num = xf86SetIntOption(local->options, "ScreenNumber", 0 ); + +@@ -1164,9 +1172,9 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + timeo = xf86SetIntOption(local->options, "LongtouchTimer", 160); + libtouchSetLongtouchTimeo(priv->libtouch, timeo); + +- libtouchSetMoveLimit(priv->libtouch, +- xf86SetIntOption( local->options, +- "MoveLimit", 180 )); ++ priv->move_limit = xf86SetIntOption( local->options, ++ "MoveLimit", 180 ); ++ libtouchSetMoveLimit(priv->libtouch, priv->move_limit); + + priv->rotate = EV_ROTATE_NONE; + s = xf86FindOptionValue(local->options, "Rotate"); +@@ -1175,7 +1183,11 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + priv->rotate = EV_ROTATE_CW; + } else if (xf86NameCmp(s, "CCW") == 0 ) { + priv->rotate = EV_ROTATE_CCW; +- } ++ } else if (xf86NameCmp(s, "UD") == 0 ) { ++ priv->rotate = EV_ROTATE_UD; ++ } ++ ++ + } + + if (priv->rotate == EV_ROTATE_NONE) { +@@ -1207,9 +1219,10 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + priv->diff[i][0], priv->diff[i][1]); + } + ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 + xf86AlwaysCore(local, TRUE); ++#endif + priv->touch_flags = 0; +- + local->history_size = xf86SetIntOption( local->options, "HistorySize", 0 ); + + /* prepare to process touch packets */ +@@ -1232,6 +1245,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + + xf86CloseSerial(local->fd); + local->fd = -1; ++ + return (local); + } + +@@ -1243,3 +1257,58 @@ EVTouchPtrCtrl(DeviceIntPtr device, PtrC + Ho Hum. + */ + } ++ ++ ++static void ++PostMotionEvent(LocalDevicePtr local) { ++int cur_x, cur_y; ++EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); ++ ++ cur_x = priv->cur_x; ++ cur_y = priv->cur_y; ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2 ++ ConvertProc(local,0,2,priv->cur_x,priv->cur_y,0,0,0,0,&cur_x,&cur_y); ++#endif ++ ++xf86PostMotionEvent (local->dev, TRUE, 0, 2, cur_x, cur_y); ++} ++ ++static void ++PostProximityEvent(LocalDevicePtr local, int is_in) { ++int cur_x, cur_y; ++EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); ++ ++ cur_x = priv->cur_x; ++ cur_y = priv->cur_y; ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2 ++ ConvertProc(local,0,2,priv->cur_x,priv->cur_y,0,0,0,0,&cur_x,&cur_y); ++#endif ++ ++xf86PostProximityEvent(local->dev, is_in, 0, 2, cur_x,cur_y); ++} ++ ++static void ++PostButtonEvent(LocalDevicePtr local, int button, int is_down,int x, int y) { ++EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); ++ ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2 ++ ConvertProc(local,0,2,x,y,0,0,0,0,&x,&y); ++#endif ++ ++xf86PostButtonEvent (local->dev, TRUE, button, is_down, 0, 2, x, y); ++} ++ ++ ++static void InputSetScreen(LocalDevicePtr local) { ++int cur_x, cur_y; ++EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); ++ ++ cur_x = priv->cur_x; ++ cur_y = priv->cur_y; ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2 ++ ConvertProc(local,0,2,priv->cur_x,priv->cur_y,0,0,0,0,&cur_x,&cur_y); ++#endif ++ ++xf86XInputSetScreen(local,priv->screen_num,cur_x,cur_y); ++} ++ +Index: xserver-xorg-input-evtouch/evtouch.h +=================================================================== +--- xserver-xorg-input-evtouch.orig/evtouch.h 2008-02-02 21:49:20.823984091 +0900 ++++ xserver-xorg-input-evtouch/evtouch.h 2008-02-02 21:49:39.734971242 +0900 +@@ -42,6 +42,7 @@ + #define EV_ROTATE_NONE 0 + #define EV_ROTATE_CW 1 + #define EV_ROTATE_CCW 2 ++#define EV_ROTATE_UD 3 + + #define EV_AXIS_MIN_RES 0 + #define EV_AXIS_MAX_RES 1024 +@@ -80,6 +81,7 @@ typedef struct _EVTouchPrivateRec + int max_rel_y; /* Maximum y */ + + int drag_timer; ++ int move_limit; + Bool emulate3; + int emulate3_timeout; + OsTimerPtr emulate3_timer; +@@ -138,6 +140,7 @@ typedef struct _EVTouchPrivateRec + + LibTouchRecPtr libtouch; + LocalDevicePtr local; ++ + } EVTouchPrivateRec, *EVTouchPrivatePtr; + + +Index: xserver-xorg-input-evtouch/libtouch.c +=================================================================== +--- xserver-xorg-input-evtouch.orig/libtouch.c 2008-02-02 21:49:36.899983517 +0900 ++++ xserver-xorg-input-evtouch/libtouch.c 2008-02-02 21:49:39.734971242 +0900 +@@ -52,6 +52,7 @@ typedef struct state { + int (*handle_state)(LibTouchRecPtr priv); + void (*action)(LibTouchRecPtr priv, int btn, int x, int y); + int btn; ++ int drag_btn; + } state_t; + + +@@ -68,16 +69,14 @@ typedef enum states { + static void btn_down_action(LibTouchRecPtr priv, int btn, int x, int y) + { + DBG(4, ErrorF("LibTouch: Issuing Button %d down\n", btn)); +- xf86PostButtonEvent(priv->local->dev, TRUE, +- btn, 1, 0, 2, x, y); ++ priv->post_button_proc(priv->local,btn, 1,x,y); + priv->pressed_btn_stat |= 1 << btn; + } + + static void btn_up_action(LibTouchRecPtr priv, int btn, int x, int y) + { + DBG(4, ErrorF("LibTouch: Issuing Button %d up\n", btn)); +- xf86PostButtonEvent(priv->local->dev, TRUE, +- btn, 0, 0, 2, x, y); ++ priv->post_button_proc(priv->local,btn, 0,x,y); + priv->pressed_btn_stat &= ~(1 << btn); + } + +@@ -103,13 +102,13 @@ static int handle_oneandahalftap(LibTouc + static void dump_configuration(); + + state_t state_ar[] = { +- {enter_untouched, handle_untouched, NULL, 0}, +- {enter_touched, handle_touched, NULL, 0}, +- {enter_longtouched, handle_longtouched, btn_down_action, 1}, +- {enter_moving, handle_moving, NULL, 0}, +- {enter_maybetap, handle_maybetap, btn_click_action, 1}, +- {enter_oneandahalftap, handle_oneandahalftap, btn_down_action, 3}, +- {NULL, NULL, NULL, -1}, ++ {enter_untouched, handle_untouched, NULL, 0,-1}, ++ {enter_touched, handle_touched, NULL, 0,-1}, ++ {enter_longtouched, handle_longtouched, btn_down_action, 1,-1}, ++ {enter_moving, handle_moving, NULL, 0,-1}, ++ {enter_maybetap, handle_maybetap, btn_click_action, 1,-1}, ++ {enter_oneandahalftap, handle_oneandahalftap, btn_down_action, 3,-1}, ++ {NULL, NULL, NULL, -1,-1}, + }; + + char *state_str[] = { +@@ -142,6 +141,16 @@ char *state_button_str[] = { + NULL, + }; + ++char *state_drag_str[] = { ++ "untouched_drag", ++ "touched_drag", ++ "longtouched_drag", ++ "moving_drag", ++ "maybetapped_drag", ++ "oneandahalftap_drag", ++ NULL, ++}; ++ + char *action_str[] = { + "down", + "up", +@@ -177,13 +186,13 @@ void libtouchSetMoveLimit(LibTouchRecPtr + } + + +-void libtouchInit(LibTouchRecPtr libtouch, LocalDevicePtr local) ++void libtouchInit(LibTouchRecPtr libtouch, LocalDevicePtr local,pointer post_button_proc) + { + int state_action_idx = 0; + int state_button_idx = 0; ++ int state_drag_idx = 0; + int action_idx = 0; + int btn; +- + char *str; + + xf86memset(libtouch, 0, sizeof(LibTouchRec)); +@@ -193,6 +202,7 @@ void libtouchInit(LibTouchRecPtr libtouc + libtouch->local = local; + libtouch->move_limit = 30; + ++ libtouch->post_button_proc = post_button_proc; + /* + Actions: up, down, click + +@@ -228,6 +238,11 @@ void libtouchInit(LibTouchRecPtr libtouc + } + } + ++ /* parse dragging for the states, that is which button sent to be as down, when in state and about to change to MOVING state */ ++ for (state_drag_idx = 0; state_drag_str[state_drag_idx] != NULL; state_drag_idx++) { ++ btn = xf86SetIntOption(local->options, state_drag_str[state_drag_idx], -1); ++ if (btn != -1) state_ar[state_drag_idx].drag_btn = btn; ++ } + + dump_configuration(); + } +@@ -359,10 +374,7 @@ static void enter_untouched(LibTouchRecP + for (i = 0; i < bit_size; i++) + if (priv->pressed_btn_stat & (1 << i)) { + DBG(4, ErrorF("LibTouch: Issuing Button-release %d\n", i)); +- xf86PostButtonEvent(priv->local->dev, TRUE, +- i, 0, 0, 2, +- priv->cur_x, +- priv->cur_y); ++ priv->post_button_proc(priv->local,i, 0,priv->cur_x,priv->cur_y); + } + + priv->pressed_btn_stat = 0; +@@ -445,6 +457,10 @@ static int handle_touched(LibTouchRecPtr + if (priv->cur_x != priv->old_x) { + dx = delta(priv->touch_x, priv->cur_x); + if (dx > priv->move_limit) { ++ if((state_ar[S_TOUCHED].drag_btn != -1) && (priv->touch_time != priv->now)){ ++ libtouchSetTime(priv, GetTimeInMillis()); ++ btn_down_action(priv, state_ar[S_TOUCHED].drag_btn, priv->cur_x,priv->cur_y); ++ } + return S_MOVING; + } + } +@@ -454,7 +470,10 @@ static int handle_touched(LibTouchRecPtr + if (priv->cur_y != priv->old_y) { + dy = delta(priv->touch_y, priv->cur_y); + if (dy > priv->move_limit) { +- return S_MOVING; ++ if((state_ar[S_TOUCHED].drag_btn != -1) && (priv->touch_time != priv->now)){ ++ libtouchSetTime(priv, GetTimeInMillis()); ++ btn_down_action(priv, state_ar[S_TOUCHED].drag_btn, priv->cur_x,priv->cur_y); ++} return S_MOVING; + } + } + } +@@ -500,7 +519,7 @@ static int handle_longtouched(LibTouchRe + } else { + if (priv->cur_x != priv->old_x) { + dx = delta(priv->touch_x, priv->cur_x); +- if (dx > priv->move_limit) ++ if (dx > priv->move_limit) + rc = S_MOVING; + } + +Index: xserver-xorg-input-evtouch/libtouch.h +=================================================================== +--- xserver-xorg-input-evtouch.orig/libtouch.h 2008-02-02 21:49:36.899983517 +0900 ++++ xserver-xorg-input-evtouch/libtouch.h 2008-02-02 21:49:39.734971242 +0900 +@@ -50,6 +50,7 @@ typedef struct _libtouch { + CARD32 past; + CARD32 now; + LocalDevicePtr local; ++ void (*post_button_proc)(LocalDevicePtr local,int button, int is_down,int x,int y); + } LibTouchRec, *LibTouchRecPtr; + + void libtouchSetDebugLevel(int level); +@@ -59,7 +60,7 @@ void libtouchSetOneandahalftapTimeo(LibT + void libtouchSetTime(LibTouchRecPtr libtouch, CARD32 now); + void libtouchSetMoveLimit(LibTouchRecPtr libtouch, int move_limit); + +-void libtouchInit(LibTouchRecPtr libtouch, LocalDevicePtr local); ++void libtouchInit(LibTouchRecPtr libtouch, LocalDevicePtr local,pointer post_button_proc); + + void libtouchSetPos(LibTouchRecPtr libtouch, int x, int y); + void libtouchTriggerSM(LibTouchRecPtr libtouch, LibTouchState_t touch); only in patch2: unchanged: --- xf86-input-evtouch-0.8.7.orig/debian/patches/07_random_fixes_for_06.patch +++ xf86-input-evtouch-0.8.7/debian/patches/07_random_fixes_for_06.patch @@ -0,0 +1,523 @@ +# Description: +# o Random whitespace fixes +# o uninitialized variables warning fix +# +Index: xserver-xorg-input-evtouch/evtouch.c +=================================================================== +--- xserver-xorg-input-evtouch.orig/evtouch.c 2008-02-03 11:51:32.082972688 +0900 ++++ xserver-xorg-input-evtouch/evtouch.c 2008-02-03 11:51:32.106981862 +0900 +@@ -1,6 +1,6 @@ + /* + * +- * Copyright 2004 by Kenan Esau , Baltmannsweiler, ++ * Copyright 2004 by Kenan Esau , Baltmannsweiler, + * Germany. + * + * Permission to use, copy, modify, distribute, and sell this software and its +@@ -182,17 +182,17 @@ static const char *default_options[] = + static int + ControlProc(LocalDevicePtr device, xDeviceCtl *ctrl); + +-static void ++static void + PostMotionEvent(LocalDevicePtr local); + +-static void ++static void + PostProximityEvent(LocalDevicePtr local,int is_in); + +-static void ++static void + PostButtonEvent(LocalDevicePtr local, int button, + int is_down, int x,int y); + +-static void ++static void + InputSetScreen(LocalDevicePtr local); + + +@@ -216,7 +216,7 @@ emulate3Timer(OsTimerPtr timer, CARD32 n + + PostMotionEvent(local); + +- /* ++ /* + * Emit a button press -- release is handled in EVTouchLBRBEvent + */ + if ( ( priv->touch_flags & LB_STAT ) && +@@ -241,11 +241,11 @@ emulate3Timer(OsTimerPtr timer, CARD32 n + + priv->emulate3_timer_expired = TRUE; + xf86UnblockSIGIO(sigstate); +- ++ + return 0; + } + +-static void DoBtnAction(EVTouchPrivatePtr priv) ++static void DoBtnAction(EVTouchPrivatePtr priv) + { + int btn = 0; + LocalDevicePtr local = priv->local; +@@ -253,7 +253,7 @@ static void DoBtnAction(EVTouchPrivatePt + DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, priv->btn_count); + + for (btn = 0; btn < priv->btn_count; btn++) { +- DBGOUT(9, "EVTouch: %s do_it = %d \n", ++ DBGOUT(9, "EVTouch: %s do_it = %d \n", + __FUNCTION__, priv->btn_actions[btn].do_it); + if (priv->btn_actions[btn].do_it != 0) { + if (priv->emulate3_timer != NULL) +@@ -263,10 +263,10 @@ static void DoBtnAction(EVTouchPrivatePt + priv->emulate3_timer_expired = FALSE; + } + +- DBGOUT(2, "EVTouch: %s btn = %d action = %d\n", +- __FUNCTION__, btn, ++ DBGOUT(2, "EVTouch: %s btn = %d action = %d\n", ++ __FUNCTION__, btn, + priv->btn_actions[btn].action); +- PostButtonEvent (local, btn, priv->btn_actions[btn].action,priv->cur_x,priv->cur_y); ++ PostButtonEvent (local, btn, priv->btn_actions[btn].action,priv->cur_x,priv->cur_y); + + priv->btn_actions[btn].do_it = 0; + priv->btn_actions[btn].action = 0; +@@ -318,7 +318,7 @@ void EVTouchProcessAbs(EVTouchPrivatePtr + PostButtonEvent (local, 5,1,priv->cur_x,priv->cur_y); + PostButtonEvent (local, 5,0,priv->cur_x,priv->cur_y); + } +- } ++ } + } + } + +@@ -337,7 +337,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr + if (priv->cur_x < priv->min_x) + priv->cur_x = priv->min_x; + return; +- } ++ } + if ( ev->code == REL_Y ) { + priv->cur_y += ev->value; + if (priv->cur_y > priv->max_y) +@@ -346,7 +346,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr + priv->cur_y = priv->min_y; + return; + } +- ++ + libtouchSetPos(priv->libtouch, priv->cur_x, priv->cur_y); + } + +@@ -363,12 +363,12 @@ void EVTouchLBRBEvent(EVTouchPrivatePtr + + if (priv->emulate3) { + if ( (ev->value==1) && (priv->emulate3_timer==NULL) ) +- priv->emulate3_timer = TimerSet(priv->emulate3_timer, ++ priv->emulate3_timer = TimerSet(priv->emulate3_timer, + 0, + priv->emulate3_timeout, + emulate3Timer, + local); +- ++ + if ( (ev->value == 1) && (ev->code == BTN_LEFT) ) { + priv->touch_flags |= LB_STAT; + } +@@ -376,8 +376,8 @@ void EVTouchLBRBEvent(EVTouchPrivatePtr + priv->touch_flags |= RB_STAT; + } + +- if ( (ev->value == 0) && +- (priv->touch_flags & RB_STAT) && ++ if ( (ev->value == 0) && ++ (priv->touch_flags & RB_STAT) && + (priv->touch_flags & LB_STAT) ) { + DBGOUT(2, "EVTouch: Middle Release\n"); + priv->touch_flags &= ~LB_STAT; +@@ -393,7 +393,7 @@ void EVTouchLBRBEvent(EVTouchPrivatePtr + DBGOUT(2, "EVTouch: Right Release\n"); + priv->touch_flags &= ~RB_STAT; + SetBtnAction(priv, 3, BTN_RELEASE); +- } ++ } + } else { + if (ev->code == BTN_LEFT) { + SetBtnAction(priv, 1, ev->value); +@@ -418,11 +418,11 @@ void EVTouchProcessKey(EVTouchPrivatePtr + + DBGOUT(2, "EVTouch: %s\n", __FUNCTION__); + ev = &priv->ev; +- if ( (ev->code == BTN_LEFT) || ++ if ( (ev->code == BTN_LEFT) || + (ev->code == BTN_RIGHT) || + (ev->code == BTN_MIDDLE) ) { + +- /* give lb and rb-events some special treatment ++ /* give lb and rb-events some special treatment + (emulate3 or not, ...) */ + EVTouchLBRBEvent(priv); + return; +@@ -468,7 +468,7 @@ DeviceOn (DeviceIntPtr dev) + { + LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; + EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); +- ++ + local->fd = xf86OpenSerial(local->options); + + DBGOUT(2, "EVTouch: %s\n", __FUNCTION__ ); +@@ -484,7 +484,7 @@ DeviceOn (DeviceIntPtr dev) + // breaks compilation + // DBG (9, XisbTrace (priv->buffer, 1)); + +- if (!priv->buffer) ++ if (!priv->buffer) + { + xf86CloseSerial(local->fd); + local->fd = -1; +@@ -526,7 +526,7 @@ DeviceOff (DeviceIntPtr dev) + DBGOUT(2, "EVTouch: %s\n", __FUNCTION__ ); + + if (local->fd != -1) +- { ++ { + ioctl(local->fd, EVIOCGRAB, (void *)0); + xf86RemoveEnabledDevice (local); + if (priv->buffer) +@@ -564,7 +564,7 @@ DeviceInit (DeviceIntPtr dev) + + priv->btn_count = EV_MAX_BUTTONS; + +- /* ++ /* + * these have to be here instead of in the SetupProc, because when the + * SetupProc is run at server startup, screenInfo is not setup yet + */ +@@ -574,9 +574,9 @@ DeviceInit (DeviceIntPtr dev) + priv->screen_height = pScrn->virtualY; + priv->pViewPort_X0 = &(pScrn->frameX0); /* initialize the pointers to the viewport coords */ + if ( (priv->screen_width != priv->phys_width) || +- (priv->screen_height != priv->phys_height) ) ++ (priv->screen_height != priv->phys_height) ) + priv->virtual = 1; +- else ++ else + priv->virtual = 0; + + priv->pViewPort_Y0 = &(pScrn->frameY0); +@@ -591,24 +591,24 @@ DeviceInit (DeviceIntPtr dev) + DBGOUT(2, "EVTouch: MaxValue H,V: %d %d\n", pScrn->maxHValue, pScrn->maxVValue); + + priv->screen_width = screenInfo.screens[priv->screen_num]->width; +- priv->screen_height = screenInfo.screens[priv->screen_num]->height; ++ priv->screen_height = screenInfo.screens[priv->screen_num]->height; + +- /* ++ /* + * Device reports button press for 5 buttons. + */ + if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE) + { + ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n"); + return BadAlloc; +- } ++ } + +- DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, ++ DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, + priv->btn_count); + priv->btn_actions = xcalloc(priv->btn_count, sizeof(BtnAction)); +- xf86memset(priv->btn_actions, 0, ++ xf86memset(priv->btn_actions, 0, + priv->btn_count * sizeof(BtnAction)); +- +- DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, ++ ++ DBGOUT(2, "EVTouch: %s btn_count=%d\n", __FUNCTION__, + priv->btn_count); + + if (InitFocusClassDeviceStruct(dev) == FALSE) { +@@ -616,7 +616,7 @@ DeviceInit (DeviceIntPtr dev) + return !Success; + } + +- /* ++ /* + * Device reports motions on 2 axes in absolute coordinates. + * Axes min and max values are reported in raw coordinates. + */ +@@ -654,7 +654,7 @@ DeviceInit (DeviceIntPtr dev) + priv->cur_y=(priv->max_y - priv->min_y)/2; + libtouchSetPos(priv->libtouch, priv->cur_x, priv->cur_y); + +- ++ + if (InitProximityClassDeviceStruct (dev) == FALSE) + { + ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n"); +@@ -667,7 +667,7 @@ DeviceInit (DeviceIntPtr dev) + return !Success; + } + +- /* ++ /* + * Allocate the motion events buffer. + */ + xf86MotionHistoryAllocate (local); +@@ -748,7 +748,7 @@ EVTouchGetPacket (EVTouchPrivatePtr priv + if (sizeof(priv->ev) == count) { + count = 0; + EVTouchDumpPacketToLog(priv); +- ++ + return Success; + } + } +@@ -764,7 +764,7 @@ static void ReadInput (LocalDevicePtr lo + + EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); + +- /* ++ /* + * set blocking to -1 on the first call because we know there is data to + * read. Xisb automatically clears it after one successful read so that + * succeeding reads are preceeded buy a select with a 0 timeout to prevent +@@ -815,7 +815,7 @@ static void ReadInput (LocalDevicePtr lo + break; + } + +- DBGOUT( 2, "EVTouch: setting (x/y)=(%d/%d)\n", ++ DBGOUT( 2, "EVTouch: setting (x/y)=(%d/%d)\n", + priv->cur_x, priv->cur_y); + + } +@@ -855,7 +855,7 @@ static int + SwitchMode (ClientPtr client, DeviceIntPtr dev, int mode) + { + DBGOUT(2, "EVTouch: %s\n", __FUNCTION__); +- ++ + return (!Success); + } + +@@ -884,19 +884,20 @@ ConvertProc ( LocalDevicePtr local, + float dx = 0, dy = 0; + + int max_x, max_y; +- int xc, yc; ++ int xc = 0, yc = 0; + int screen_width = 0; + int screen_height = 0; + #ifdef EVDBG + int i = 0; + #endif + +- EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); ++ EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); + ScrnInfoPtr pScrn = xf86Screens[priv->screen_num]; + + // X Segfaults +-// Rotation rotation = RRGetRotation(pScrn->pScreen); ++ Rotation rotation = RRGetRotation(pScrn->pScreen); + ++ DBGOUT(2, "EVTouch: RRRotation=%d\n", rotation); + DBGOUT(2, "EVTouch: FIRST: v0=%d v1=%d\n", v0, v1); + + /*correction of raw coordinates*/ +@@ -910,21 +911,20 @@ ConvertProc ( LocalDevicePtr local, + DBGOUT(2, "EVTouch: Scaling coordinates\n"); + xc = v0 - priv->min_x; + yc = v1 - priv->min_y; +- ++ + max_x = priv->max_x - priv->min_x; + max_y = priv->max_y - priv->min_y; + + +-// if (priv->rotate == EV_ROTATE_NONE) { ++ if (priv->rotate == EV_ROTATE_NONE) { + screen_width = pScrn->currentMode->HDisplay; + screen_height = pScrn->currentMode->VDisplay; +-/* Swapping is done below in Coords! Leave those to be able to calc correct mapping ++/* Swapping is done below in Coords! Leave those to be able to calc correct mapping */ + } else { + screen_width = pScrn->currentMode->VDisplay; + screen_height = pScrn->currentMode->HDisplay; + } + +-*/ + if (xc < (max_x / 2)) { + /* + left +@@ -942,7 +942,7 @@ ConvertProc ( LocalDevicePtr local, + (float)(cx[0] * cy[0] * priv->diff[0][0]) + + (float)(cx[1] * cy[1] * priv->diff[4][0]) + + (float)(cx[0] * cy[1] * priv->diff[3][0])); +- ++ + dy = ((float) (cx[1] * cy[0] * priv->diff[1][1]) + + (float)(cx[0] * cy[0] * priv->diff[0][1]) + + (float)(cx[1] * cy[1] * priv->diff[4][1]) + +@@ -961,7 +961,7 @@ ConvertProc ( LocalDevicePtr local, + (float)(cx[0] * cy[0] * priv->diff[3][0]) + + (float)(cx[1] * cy[1] * priv->diff[7][0]) + + (float)(cx[0] * cy[1] * priv->diff[6][0])); +- ++ + dy = ((float) (cx[1] * cy[0] * priv->diff[4][1]) + + (float)(cx[0] * cy[0] * priv->diff[3][1]) + + (float)(cx[1] * cy[1] * priv->diff[7][1]) + +@@ -985,7 +985,7 @@ ConvertProc ( LocalDevicePtr local, + (float)(cx[0] * cy[0] * priv->diff[1][0]) + + (float)(cx[1] * cy[1] * priv->diff[5][0]) + + (float)(cx[0] * cy[1] * priv->diff[4][0])); +- ++ + dy = ((float) (cx[1] * cy[0] * priv->diff[2][1]) + + (float)(cx[0] * cy[0] * priv->diff[1][1]) + + (float)(cx[1] * cy[1] * priv->diff[5][1]) + +@@ -1004,7 +1004,7 @@ ConvertProc ( LocalDevicePtr local, + (float)(cx[0] * cy[0] * priv->diff[4][0]) + + (float)(cx[1] * cy[1] * priv->diff[8][0]) + + (float)(cx[0] * cy[1] * priv->diff[7][0])); +- ++ + dy = ((float) (cx[1] * cy[0] * priv->diff[5][1]) + + (float)(cx[0] * cy[0] * priv->diff[4][1]) + + (float)(cx[1] * cy[1] * priv->diff[8][1]) + +@@ -1014,12 +1014,12 @@ ConvertProc ( LocalDevicePtr local, + + + #ifdef EVDBG +- for (i=0; i<3; i++) ++ for (i=0; i<3; i++) + xf86ErrorFVerb(2, "cx[%d]=%f cy[%d]=%f\n", i, cx[i] + ,i, cy[i]); +- +- DBGOUT(2, "EVTouch: ViewPort_X0=%d ViewPort_Y0=%d\n", +- *(priv->pViewPort_X0), ++ ++ DBGOUT(2, "EVTouch: ViewPort_X0=%d ViewPort_Y0=%d\n", ++ *(priv->pViewPort_X0), + *(priv->pViewPort_Y0)); + DBGOUT(2, "EVTouch: dx=%f dy=%f\n", dx, dy); + #endif +@@ -1030,7 +1030,7 @@ ConvertProc ( LocalDevicePtr local, + if (priv->swap_y == TRUE) + yc = screen_height - yc; + +- /* ususally we DON'T swap x -- but if swap_x is 1 ++ /* ususally we DON'T swap x -- but if swap_x is 1 + => go on and swap */ + if (priv->swap_x == TRUE) + xc = screen_width - xc; +@@ -1056,7 +1056,7 @@ ConvertProc ( LocalDevicePtr local, + break; + } + +-/* X Segfaults on rotation setting ++/* X Segfaults on rotation setting */ + switch (rotation) { + case RR_Rotate_0: + v0 = xc; +@@ -1080,14 +1080,12 @@ ConvertProc ( LocalDevicePtr local, + break; + } + +- +-*/ + } + + DBGOUT(2, "EVTouch: FINAL: v0=%d v1=%d\n", v0, v1); + +- *x = xc; +- *y = yc; ++ *x = v0; ++ *y = v1; + return (TRUE); + } + +@@ -1160,7 +1158,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + priv->button_number = xf86SetIntOption(local->options, "ButtonNumber", 2 ); + + priv->emulate3 = xf86SetBoolOption(local->options, "Emulate3Buttons", TRUE); +- priv->emulate3_timeout = xf86SetIntOption(local->options, ++ priv->emulate3_timeout = xf86SetIntOption(local->options, + "Emulate3Timeout", 50); + + debug_level = xf86SetIntOption(local->options, "DebugLevel", 0); +@@ -1180,33 +1178,33 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + s = xf86FindOptionValue(local->options, "Rotate"); + if (s) { + if (xf86NameCmp(s, "CW") == 0) { +- priv->rotate = EV_ROTATE_CW; ++ priv->rotate = EV_ROTATE_CW; + } else if (xf86NameCmp(s, "CCW") == 0 ) { + priv->rotate = EV_ROTATE_CCW; + } else if (xf86NameCmp(s, "UD") == 0 ) { + priv->rotate = EV_ROTATE_UD; + } + +- ++ + } + + if (priv->rotate == EV_ROTATE_NONE) { + priv->max_rel_x = priv->max_x; + priv->max_rel_y = priv->max_y; + priv->min_rel_x = priv->min_x; +- priv->min_rel_y = priv->min_y; ++ priv->min_rel_y = priv->min_y; + } else { + priv->max_rel_x = priv->max_y; + priv->max_rel_y = priv->max_x; + priv->min_rel_x = priv->min_y; +- priv->min_rel_y = priv->min_x; ++ priv->min_rel_y = priv->min_x; + } + + priv->swap_y = xf86SetBoolOption(local->options, "SwapY", FALSE); + priv->swap_x = xf86SetBoolOption(local->options, "SwapX", FALSE); + +- /* +- get calibration parameters from XF86Config ++ /* ++ get calibration parameters from XF86Config + */ + for (i = 0; i < 9; i++){ + sprintf(tmp_str, "x%d", i); +@@ -1215,10 +1213,10 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + sprintf(tmp_str, "y%d", i); + priv->diff[i][1] = xf86SetIntOption( local->options, + tmp_str, 0 ); +- DBGOUT(2, "(diff[%d][0]/diff[%d][1])=(%d/%d)\n", i, i, ++ DBGOUT(2, "(diff[%d][0]/diff[%d][1])=(%d/%d)\n", i, i, + priv->diff[i][0], priv->diff[i][1]); + } +- ++ + #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 + xf86AlwaysCore(local, TRUE); + #endif +@@ -1228,9 +1226,9 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + /* prepare to process touch packets */ + EVTouchNewPacket (priv); + +- /* ++ /* + if started in calibration-mode: +- - open named pipe ++ - open named pipe + */ + if (priv->calibrate) { + priv->fifo = open("/tmp/ev_calibrate", O_RDWR, 0); +@@ -1252,7 +1250,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevP + static void + EVTouchPtrCtrl(DeviceIntPtr device, PtrCtrl *ctrl) + { +- /* I have no clue what this does, except that registering it stops the ++ /* I have no clue what this does, except that registering it stops the + X server segfaulting in ProcGetPointerMapping() + Ho Hum. + */