File wait.diff of Package x11-input-synaptics

--- src/eventcomm.c.orig	2008-09-08 01:33:28.000000000 +0000
+++ src/eventcomm.c	2008-09-08 02:07:53.000000000 +0000
@@ -313,7 +313,10 @@ EventAutoDevProbe(LocalDevicePtr local)
     int i;
     Bool touchpad_found = FALSE;
     struct dirent **namelist;
+    int wait = 0;
+    const int max_wait = 2000;
 
+    while (wait <= max_wait && !touchpad_found) {
     i = scandir(DEV_INPUT_EVENT, &namelist, EventDevOnly, alphasort);
     if (i < 0) {
 		ErrorF("Couldn't open %s\n", DEV_INPUT_EVENT);
@@ -338,8 +341,8 @@ EventAutoDevProbe(LocalDevicePtr local)
 
 			if (event_query_is_touchpad(fd)) {
 				touchpad_found = TRUE;
-			    xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n",
-				    local->name, fname);
+			    xf86Msg(X_PROBED, "%s auto-dev sets device to %s (waited %d msec)\n",
+				    local->name, fname, wait);
			    local->options =
				xf86ReplaceStrOption(local->options, "Device", fname);
 			    event_query_axis_ranges(fd, local);
@@ -347,6 +350,13 @@ EventAutoDevProbe(LocalDevicePtr local)
 		}
 		free(namelist[i]);
     }
+    if (!touchpad_found) {
+	ErrorF("%s waiting 100 msec to become devices ready\n", local->name); 
+	usleep(100*1000);
+	wait += 100;
+	ErrorF("%s waiting time total: %d\n", local->name, wait);
+    }
+    } /* while (wait <= max_wait && !touchpad_found) */
 	free(namelist);
 
 	if (!touchpad_found) {
openSUSE Build Service is sponsored by