summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-11-02 11:51:49 +0100
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:01:20 +0200
commit91fdf85fba2fd2a46db154c67c7b4e5bc2774629 (patch)
treee381019986ce0ad2144095ebed9cb1b50bc7a04d
parent91c7a9f8004eeed3f3c86863ae4c3c8112045fc4 (diff)
Disable the whole touchpad, not just tapping, during
keyboard activity.
-rw-r--r--synaptics.c8
-rw-r--r--syndaemon.c18
2 files changed, 10 insertions, 16 deletions
diff --git a/synaptics.c b/synaptics.c
index c3d5ea5..ef08830 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -779,10 +779,6 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState* hw)
long timeleft;
int i;
- /* If touchpad is switched off, we skip the whole thing and return delay */
- if (para->touchpad_off == TRUE)
- return delay;
-
edge = edge_detection(priv, hw->x, hw->y);
dx = dy = 0;
@@ -807,6 +803,10 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState* hw)
for (i = 0; i < 8; i++)
para->multi[i] = hw->multi[i];
+ /* If touchpad is switched off, we skip the whole thing and return delay */
+ if (para->touchpad_off == TRUE)
+ return delay;
+
/* Treat the first two multi buttons as up/down for now. */
hw->up |= hw->multi[0];
hw->down |= hw->multi[1];
diff --git a/syndaemon.c b/syndaemon.c
index 3759a08..2e0d55d 100644
--- a/syndaemon.c
+++ b/syndaemon.c
@@ -12,7 +12,7 @@
static SynapticsSHM *synshm;
static int pad_disabled;
-static int saved_tap_time;
+static Bool saved_touchpad_off;
static void usage()
@@ -26,7 +26,7 @@ static void usage()
static void signal_handler(int signum)
{
if (pad_disabled) {
- synshm->tap_time = saved_tap_time;
+ synshm->touchpad_off = saved_touchpad_off;
pad_disabled = 0;
}
kill(getpid(), signum);
@@ -119,21 +119,15 @@ static void main_loop(Display *display, double idle_time)
if (current_time > last_activity + idle_time) { /* Enable touchpad */
if (pad_disabled) {
printf("Enable\n");
- synshm->tap_time = saved_tap_time;
+ synshm->touchpad_off = saved_touchpad_off;
pad_disabled = 0;
}
} else { /* Disable touchpad */
if (!pad_disabled) {
printf("Disable\n");
- saved_tap_time = synshm->tap_time;
- synshm->tap_time = 0;
+ saved_touchpad_off = synshm->touchpad_off;
+ synshm->touchpad_off = 1;
pad_disabled = 1;
- } else {
- /* Already disabled. Update saved_tap_time if needed */
- if (synshm->tap_time) {
- printf("Updating tap_time\n");
- saved_tap_time = synshm->tap_time;
- }
}
}
@@ -143,7 +137,7 @@ static void main_loop(Display *display, double idle_time)
int main(int argc, char *argv[])
{
- double idle_time = 3.0;
+ double idle_time = 2.0;
Display *display;
int c;
int shmid;