mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-04-14 11:54:16 +00:00
Removed the saved_touchpad_off variable in syndaemon. It's
more robust to just not disable the touchpad if it already is disabled.
This commit is contained in:
10
syndaemon.c
10
syndaemon.c
@@ -12,7 +12,6 @@
|
||||
|
||||
static SynapticsSHM *synshm;
|
||||
static int pad_disabled;
|
||||
static Bool saved_touchpad_off;
|
||||
|
||||
|
||||
static void usage()
|
||||
@@ -26,7 +25,7 @@ static void usage()
|
||||
static void signal_handler(int signum)
|
||||
{
|
||||
if (pad_disabled) {
|
||||
synshm->touchpad_off = saved_touchpad_off;
|
||||
synshm->touchpad_off = 0;
|
||||
pad_disabled = 0;
|
||||
}
|
||||
kill(getpid(), signum);
|
||||
@@ -121,15 +120,14 @@ 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->touchpad_off = saved_touchpad_off;
|
||||
synshm->touchpad_off = 0;
|
||||
pad_disabled = 0;
|
||||
}
|
||||
} else { /* Disable touchpad */
|
||||
if (!pad_disabled) {
|
||||
if (!pad_disabled && !synshm->touchpad_off) {
|
||||
printf("Disable\n");
|
||||
saved_touchpad_off = synshm->touchpad_off;
|
||||
synshm->touchpad_off = 1;
|
||||
pad_disabled = 1;
|
||||
synshm->touchpad_off = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user