Function introduced with the factoring out of post_scroll_events.

Signed-off-by: Peter Hutterer <[email protected]>
---
 src/synaptics.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index c3a4ebc..9a286b5 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2264,13 +2264,11 @@ HandleState(LocalDevicePtr local, struct 
SynapticsHwState *hw)
 
     if (priv->mid_emu_state == MBE_LEFT_CLICK)
     {
-       xf86PostButtonEvent(local->dev, FALSE, 1, 1, 0, 0);
-       xf86PostButtonEvent(local->dev, FALSE, 1, 0, 0, 0);
+       post_button_click(local, 1);
        priv->mid_emu_state = MBE_OFF;
     } else if (priv->mid_emu_state == MBE_RIGHT_CLICK)
     {
-       xf86PostButtonEvent(local->dev, FALSE, 3, 1, 0, 0);
-       xf86PostButtonEvent(local->dev, FALSE, 3, 0, 0, 0);
+       post_button_click(local, 3);
        priv->mid_emu_state = MBE_OFF;
     }
 
@@ -2288,11 +2286,8 @@ HandleState(LocalDevicePtr local, struct 
SynapticsHwState *hw)
        post_scroll_events(local, scroll);
 
     if (double_click) {
-       int i;
-       for (i = 0; i < 2; i++) {
-           xf86PostButtonEvent(local->dev, FALSE, 1, !hw->left, 0, 0);
-           xf86PostButtonEvent(local->dev, FALSE, 1, hw->left, 0, 0);
-       }
+       post_button_click(local, 1);
+       post_button_click(local, 1);
     }
 
     /* Handle auto repeat buttons */
@@ -2320,8 +2315,7 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState 
*hw)
            while (change) {
                id = ffs(change);
                change &= ~(1 << (id - 1));
-               xf86PostButtonEvent(local->dev, FALSE, id, FALSE, 0, 0);
-               xf86PostButtonEvent(local->dev, FALSE, id, TRUE, 0, 0);
+               post_button_click(local, id);
            }
 
            priv->nextRepeat = hw->millis + repeat_delay;
-- 
1.6.6.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to