[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#469166: Acknowledgement (xserver-xorg-input-synaptics: syndaemon's main loop has a hard-coded poll frequency)



tags 469166 patch
thanks

Attached is a patch I wrote. It's untested.
diff -ru xfree86-driver-synaptics-0.14.7~git20070706-old/syndaemon.c xfree86-driver-synaptics-0.14.7~git20070706/syndaemon.c
--- xfree86-driver-synaptics-0.14.7~git20070706-old/syndaemon.c	2008-03-03 16:26:49.000000000 +0200
+++ xfree86-driver-synaptics-0.14.7~git20070706/syndaemon.c	2008-03-03 16:38:59.000000000 +0200
@@ -159,9 +159,8 @@
 }
 
 static void
-main_loop(Display *display, double idle_time)
+main_loop(Display *display, double idle_time, const unsigned int poll_delay)
 {
-    const int poll_delay = 20000;	    /* 20 ms */
     double last_activity = 0.0;
     double current_time;
 
@@ -232,9 +231,10 @@
     int c;
     int shmid;
     int ignore_modifier_keys = 0;
+    unsigned int poll_delay = 20000;	/* 20 ms */
 
     /* Parse command line parameters */
-    while ((c = getopt(argc, argv, "i:dtp:kK?")) != EOF) {
+    while ((c = getopt(argc, argv, "i:dtp:f:kK?")) != EOF) {
 	switch(c) {
 	case 'i':
 	    idle_time = atof(optarg);
@@ -248,6 +248,9 @@
 	case 'p':
 	    pid_file = optarg;
 	    break;
+	case 'f':
+	    poll_delay = atoi(optarg) * 1000;
+	    break;
 	case 'k':
 	    ignore_modifier_keys = 1;
 	    break;
@@ -314,7 +317,7 @@
     setup_keyboard_mask(display, ignore_modifier_keys);
 
     /* Run the main loop */
-    main_loop(display, idle_time);
+    main_loop(display, idle_time, poll_delay);
 
     return 0;
 }

Reply to: