kdrive: add protocol mouse option
kdrive probes a lot of PS/2 protocols for the mouse device, which makes the mouse unusable for some seconds after X startup. This new "protocol" option allows forcing the mouse protocol. It can be used this way: Xfbdev -mouse mouse,,protocol=ps/2 -keybd keyboard Signed-off-by: Olivier Blin <blino@mandriva.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
20d9f11abf
commit
7f027d9dc0
|
@ -961,7 +961,11 @@ MouseInit (KdPointerInfo *pi)
|
||||||
km = (Kmouse *) xalloc (sizeof (Kmouse));
|
km = (Kmouse *) xalloc (sizeof (Kmouse));
|
||||||
if (km) {
|
if (km) {
|
||||||
km->iob.avail = km->iob.used = 0;
|
km->iob.avail = km->iob.used = 0;
|
||||||
MouseFirstProtocol(km, "exps/2");
|
MouseFirstProtocol(km, pi->protocol ? pi->protocol : "exps/2");
|
||||||
|
/* MouseFirstProtocol sets state to MouseBroken for later protocol
|
||||||
|
* checks. Skip these checks if a protocol was supplied */
|
||||||
|
if (pi->protocol)
|
||||||
|
km->state = MouseWorking;
|
||||||
km->i_prot = 0;
|
km->i_prot = 0;
|
||||||
km->tty = isatty (fd);
|
km->tty = isatty (fd);
|
||||||
km->iob.fd = -1;
|
km->iob.fd = -1;
|
||||||
|
|
|
@ -220,6 +220,7 @@ struct _KdPointerInfo {
|
||||||
DeviceIntPtr dixdev;
|
DeviceIntPtr dixdev;
|
||||||
char *name;
|
char *name;
|
||||||
char *path;
|
char *path;
|
||||||
|
char *protocol;
|
||||||
InputOption *options;
|
InputOption *options;
|
||||||
int inputClass;
|
int inputClass;
|
||||||
|
|
||||||
|
|
|
@ -1166,6 +1166,8 @@ KdParsePointerOptions (KdPointerInfo *pi)
|
||||||
pi->transformCoordinates = FALSE;
|
pi->transformCoordinates = FALSE;
|
||||||
else if (!strcasecmp (option->key, "device"))
|
else if (!strcasecmp (option->key, "device"))
|
||||||
pi->path = strdup(option->value);
|
pi->path = strdup(option->value);
|
||||||
|
else if (!strcasecmp (option->key, "protocol"))
|
||||||
|
pi->protocol = strdup(option->value);
|
||||||
else
|
else
|
||||||
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
|
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
|
||||||
option->key, option->value);
|
option->key, option->value);
|
||||||
|
@ -1186,6 +1188,7 @@ KdParsePointer (char *arg)
|
||||||
return NULL;
|
return NULL;
|
||||||
pi->emulateMiddleButton = kdEmulateMiddleButton;
|
pi->emulateMiddleButton = kdEmulateMiddleButton;
|
||||||
pi->transformCoordinates = !kdRawPointerCoordinates;
|
pi->transformCoordinates = !kdRawPointerCoordinates;
|
||||||
|
pi->protocol = NULL;
|
||||||
pi->nButtons = 5; /* XXX should not be hardcoded */
|
pi->nButtons = 5; /* XXX should not be hardcoded */
|
||||||
pi->inputClass = KD_MOUSE;
|
pi->inputClass = KD_MOUSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user