ALT Linux Bugzilla
– Attachment 4837 Details for
Bug 25230
Не работает clickpad
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Патч для поддержки clickpad
alt-clickpad.patch (text/plain), 4.49 KB, created by
stalker
on 2011-03-14 21:16:47 MSK
(
hide
)
Description:
Патч для поддержки clickpad
Filename:
MIME Type:
Creator:
stalker
Created:
2011-03-14 21:16:47 MSK
Size:
4.49 KB
patch
obsolete
>diff -ruN xorg-drv-synaptics-1.4.0.old/src/eventcomm.c xorg-drv-synaptics-1.4.0/src/eventcomm.c >--- xorg-drv-synaptics-1.4.0.old/src/eventcomm.c 2011-03-04 05:36:24 +0300 >+++ xorg-drv-synaptics-1.4.0/src/eventcomm.c 2011-03-14 01:03:23 +0300 >@@ -266,6 +266,13 @@ > strcat(buf, " double"); > if ((priv->has_triple = (TEST_BIT(BTN_TOOL_TRIPLETAP, keybits) != 0))) > strcat(buf, " triple"); >+ >+ /* clickpad device reports only the single left button mask */ >+ if (priv->has_left && !priv->has_right && !priv->has_middle) { >+ priv->is_clickpad = TRUE; >+ xf86Msg(X_INFO, "%s: is Clickpad device\n", pInfo->name); >+ } >+ > > if ((TEST_BIT(BTN_0, keybits) != 0) || > (TEST_BIT(BTN_1, keybits) != 0) || >diff -ruN xorg-drv-synaptics-1.4.0.old/src/synaptics.c xorg-drv-synaptics-1.4.0/src/synaptics.c >--- xorg-drv-synaptics-1.4.0.old/src/synaptics.c 2011-03-04 05:36:24 +0300 >+++ xorg-drv-synaptics-1.4.0/src/synaptics.c 2011-03-14 01:03:39 +0300 >@@ -513,6 +513,18 @@ > vertResolution = priv->resy; > } > >+ /* Clickpad mode -- bottom area is used as buttons */ >+ if (priv->is_clickpad) { >+ int button_bottom; >+ /* Clickpad devices usually the button area at the bottom, and >+ * its size seems ca. 20% of the touchpad height no matter how >+ * large the pad is. >+ */ >+ button_bottom = priv->maxy - (abs(priv->maxy - priv->miny) * 20) / 100; >+ if (button_bottom < b && button_bottom >= t) >+ b = button_bottom; >+ } >+ > /* set the parameters */ > pars->left_edge = xf86SetIntOption(opts, "LeftEdge", l); > pars->right_edge = xf86SetIntOption(opts, "RightEdge", r); >@@ -2241,6 +2253,59 @@ > } > } > >+/* clickpad event handling */ >+static void >+handle_clickpad(InputInfoPtr pInfo, struct SynapticsHwState *hw, edge_type edge) >+{ >+ SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); >+ SynapticsParameters *para = &priv->synpara; >+ >+ if (edge & BOTTOM_EDGE) { >+ /* button area */ >+ int width = priv->maxx - priv->minx; >+ int left_button_x, right_button_x; >+ >+ /* left and right clickpad button ranges; >+ * the gap between them is interpreted as a middle-button click >+ */ >+ left_button_x = width * 2/ 5 + priv->minx; >+ right_button_x = width * 3 / 5 + priv->minx; >+ >+ /* clickpad reports only one button, and we need >+ * to fake left/right buttons depending on the touch position >+ */ >+ if (hw->left) { /* clicked? */ >+ hw->left = 0; >+ if (hw->x < left_button_x) >+ hw->left = 1; >+ else if (hw->x > right_button_x) >+ hw->right = 1; >+ else >+ hw->middle = 1; >+ } >+ >+ /* Don't move pointer position in the button area during clicked, >+ * except for horiz/vert scrolling is enabled. >+ * >+ * The synaptics driver tends to be pretty sensitive. This hack >+ * is to avoid that the pointer moves slightly and misses the >+ * poistion you aimed to click. >+ * >+ * Also, when the pointer movement is reported, the dragging >+ * (with a sort of multi-touching) doesn't work well, too. >+ */ >+ if (hw->left || !(para->scroll_edge_horiz || >+ ((edge & RIGHT_EDGE) && para->scroll_edge_vert))) >+ hw->z = 0; /* don't move pointer */ >+ >+ } else if (hw->left) { >+ /* dragging */ >+ hw->left = priv->prev_hw.left; >+ hw->right = priv->prev_hw.right; >+ hw->middle = priv->prev_hw.middle; >+ } >+ priv->prev_hw = *hw; >+} > > /* Update the hardware state in shared memory. This is read-only these days, > * nothing in the driver reads back from SHM. SHM configuration is a thing of the past. >@@ -2314,6 +2379,12 @@ > SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); > SynapticsParameters *para = &priv->synpara; > >+ edge_type edge = edge_detection(priv, hw->x, hw->y); >+ >+ /* Clickpad handling for button area */ >+ if (priv->is_clickpad) >+ handle_clickpad(pInfo, hw, edge); >+ > /* Treat the first two multi buttons as up/down for now. */ > hw->up |= hw->multi[0]; > hw->down |= hw->multi[1]; >diff -ruN xorg-drv-synaptics-1.4.0.old/src/synapticsstr.h xorg-drv-synaptics-1.4.0/src/synapticsstr.h >--- xorg-drv-synaptics-1.4.0.old/src/synapticsstr.h 2011-03-04 05:36:24 +0300 >+++ xorg-drv-synaptics-1.4.0/src/synapticsstr.h 2011-03-14 01:03:45 +0300 >@@ -239,6 +239,9 @@ > Bool has_pressure; /* device reports pressure */ > Bool has_width; /* device reports finger width */ > Bool has_scrollbuttons; /* device has physical scrollbuttons */ >+ Bool is_clickpad; /* is Clickpad device (one-button) */ >+ struct SynapticsHwState prev_hw; /* previous h/w state (for clickpad) */ >+ > > enum TouchpadModel model; /* The detected model */ > } SynapticsPrivate;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25230
: 4837