[PATCH synaptics 07/12] Use post_button_click to post doubleclicks.

Peter Hutterer peter.hutterer at who-t.net
Thu May 6 21:41:59 PDT 2010


Function introduced with the factoring out of post_scroll_events.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 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



More information about the xorg-devel mailing list