Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 13th, 2012  |  syntax: Diff  |  size: 6.12 KB  |  views: 55  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -ur xf86-input-synaptics-1.4.0.orig/src/synapticsstr.h xf86-input-synaptics-1.4.0/src/synapticsstr.h
  2. --- xf86-input-synaptics-1.4.0.orig/src/synapticsstr.h  2011-01-14 19:36:17.000000000 +0100
  3. +++ xf86-input-synaptics-1.4.0/src/synapticsstr.h       2011-01-14 19:36:03.000000000 +0100
  4. @@ -92,6 +92,7 @@
  5.      /* Parameter data */
  6.      int left_edge, right_edge, top_edge, bottom_edge; /* edge coordinates absolute */
  7.      int finger_low, finger_high, finger_press;       /* finger detection values in Z-values */
  8. +    int orientation;
  9.      int tap_time;
  10.      int tap_move;                          /* max. tapping time and movement in packets and coord. */
  11.      int single_tap_timeout;                /* timeout to recognize a single tap */
  12. diff -ur xf86-input-synaptics-1.4.0.orig/include/synaptics-properties.h xf86-input-synaptics-1.4.0/include/synaptics-properties.h
  13. --- xf86-input-synaptics-1.4.0.orig/include/synaptics-properties.h      2009-10-20 22:09:01.679710327 +0200
  14. +++ xf86-input-synaptics-1.4.0/include/synaptics-properties.h   2009-10-22 18:48:47.123708014 +0200
  15. @@ -142,4 +142,7 @@
  16.  /* 8 bit (BOOL) */
  17.  #define SYNAPTICS_PROP_GRAB "Synaptics Grab Event Device"
  18.  
  19. +/* 32 bit */
  20. +#define SYNAPTICS_ORIENTATION "Synaptics Orientation"
  21. +
  22.  #endif /* _SYNAPTICS_PROPERTIES_H_ */
  23. diff -ur xf86-input-synaptics-1.4.0.orig/src/eventcomm.c xf86-input-synaptics-1.4.0/src/eventcomm.c
  24. --- xf86-input-synaptics-1.4.0.orig/src/eventcomm.c     2009-10-20 22:09:01.683709019 +0200
  25. +++ xf86-input-synaptics-1.4.0/src/eventcomm.c  2009-10-22 21:22:58.224803290 +0200
  26. @@ -352,10 +352,28 @@
  27.         case EV_ABS:
  28.             switch (ev.code) {
  29.             case ABS_X:
  30. -               hw->x = ev.value;
  31. +               if (para->orientation==0)
  32. +                       hw->x = ev.value;
  33. +               else if (para->orientation==2)
  34. +                       hw->x = priv->maxx + priv->minx - ev.value;
  35. +               else if (para->orientation==3)
  36. +                       hw->y = (priv->maxx - ev.value) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
  37. +               else if (para->orientation==1)
  38. +                       hw->y = (ev.value - priv->minx) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
  39. +               else
  40. +                       hw->x = ev.value;
  41.                 break;
  42.             case ABS_Y:
  43. -               hw->y = ev.value;
  44. +               if (para->orientation==0)
  45. +                       hw->y = ev.value;
  46. +               else if (para->orientation==2)
  47. +                       hw->y = priv->maxy + priv->miny - ev.value;
  48. +               else if (para->orientation==3)
  49. +                       hw->x = (ev.value - priv->miny) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
  50. +               else if (para->orientation==1)
  51. +                       hw->x = (priv->maxy - ev.value) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
  52. +               else
  53. +                       hw->y = ev.value;
  54.                 break;
  55.             case ABS_PRESSURE:
  56.                 hw->z = ev.value;
  57. diff -ur xf86-input-synaptics-1.4.0.orig/src/properties.c xf86-input-synaptics-1.4.0/src/properties.c
  58. --- xf86-input-synaptics-1.4.0.orig/src/properties.c    2009-10-20 22:09:01.683709019 +0200
  59. +++ xf86-input-synaptics-1.4.0/src/properties.c 2009-10-22 18:48:47.131703654 +0200
  60. @@ -44,6 +44,7 @@
  61.  static Atom float_type;
  62.  
  63.  Atom prop_edges                 = 0;
  64.  Atom prop_finger                = 0;
  65. +Atom prop_orientation           = 0;
  66.  Atom prop_tap_time              = 0;
  67.  Atom prop_tap_move              = 0;
  68. @@ -255,6 +252,8 @@
  69.      fvalues[0] = para->press_motion_min_factor;
  70.      fvalues[1] = para->press_motion_max_factor;
  71.  
  72. +    prop_orientation = InitAtom(pInfo->dev, SYNAPTICS_ORIENTATION, 32, 1, &para->orientation);
  73. +
  74.      prop_pressuremotion_factor = InitFloatAtom(pInfo->dev, SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR, 2, fvalues);
  75.  
  76.      prop_grab = InitAtom(pInfo->dev, SYNAPTICS_PROP_GRAB, 8, 1, &para->grab_event_device);
  77. @@ -270,7 +273,13 @@
  78.          para = &tmp;
  79.      }
  80.  
  81. -    if (property == prop_edges)
  82. +       if (property == prop_orientation)
  83. +       {
  84. +        if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
  85. +            return BadMatch;
  86. +               para->orientation = *(INT32*)prop->data;
  87. +       }
  88. +       else if (property == prop_edges)
  89.      {
  90.          INT32 *edges;
  91.          if (prop->size != 4 || prop->format != 32 || prop->type != XA_INTEGER)
  92. diff -ur xf86-input-synaptics-1.4.0.orig/src/synaptics.c xf86-input-synaptics-1.4.0/src/synaptics.c
  93. --- xf86-input-synaptics-1.4.0.orig/src/synaptics.c     2009-10-20 22:09:01.683709019 +0200
  94. +++ xf86-input-synaptics-1.4.0/src/synaptics.c  2009-10-22 18:57:34.363700791 +0200
  95. @@ -433,6 +433,7 @@
  96.      horizTwoFingerScroll = FALSE;
  97.  
  98.      /* set the parameters */
  99. +    pars->orientation = xf86SetIntOption(opts, "Orientation", 0);
  100.      pars->left_edge = xf86SetIntOption(opts, "LeftEdge", l);
  101.      pars->right_edge = xf86SetIntOption(opts, "RightEdge", r);
  102.      pars->top_edge = xf86SetIntOption(opts, "TopEdge", t);
  103. @@ -2391,8 +2391,14 @@
  104.      int xCenter = (priv->synpara.left_edge + priv->synpara.right_edge) / 2;
  105.      int yCenter = (priv->synpara.top_edge + priv->synpara.bottom_edge) / 2;
  106.  
  107. -    hw->x = (hw->x - xCenter) * priv->horiz_coeff + xCenter;
  108. -    hw->y = (hw->y - yCenter) * priv->vert_coeff + yCenter;
  109. +    if ((priv->synpara.orientation==1) || (priv->synpara.orientation==3)) {
  110. +        hw->x = (hw->x - xCenter) * priv->vert_coeff + xCenter;
  111. +        hw->y = (hw->y - yCenter) * priv->horiz_coeff + yCenter;
  112. +    } else {
  113. +        hw->x = (hw->x - xCenter) * priv->horiz_coeff + xCenter;
  114. +        hw->y = (hw->y - yCenter) * priv->vert_coeff + yCenter;
  115. +    }
  116. +
  117.  }
  118.  
  119.  void
  120. diff -ur xf86-input-synaptics-1.4.0.orig/tools/synclient.c xf86-input-synaptics-1.4.0/tools/synclient.c
  121. --- xf86-input-synaptics-1.4.0.orig/tools/synclient.c   2011-01-14 19:22:01.000000000 +0100
  122. +++ xf86-input-synaptics-1.4.0/tools/synclient.c        2011-01-14 19:19:13.000000000 +0100
  123. @@ -78,6 +78,7 @@
  124.      {"RightEdge",             PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,       32,     1},
  125.      {"TopEdge",               PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,       32,     2},
  126.      {"BottomEdge",            PT_INT,    0, 10000, SYNAPTICS_PROP_EDGES,       32,     3},
  127. +    {"Orientation",           PT_INT,    0, 3,     SYNAPTICS_ORIENTATION,      32,     0},
  128.      {"FingerLow",             PT_INT,    0, 255,   SYNAPTICS_PROP_FINGER,      32,     0},
  129.      {"FingerHigh",            PT_INT,    0, 255,   SYNAPTICS_PROP_FINGER,      32,     1},
  130.      {"FingerPress",           PT_INT,    0, 256,   SYNAPTICS_PROP_FINGER,      32,     2},
clone this paste RAW Paste Data