diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c index e9e2649..14b529d 100644 --- a/src/bsd_mouse.c +++ b/src/bsd_mouse.c @@ -102,7 +102,7 @@ SupportedInterfaces(void) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC; #else - return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO; + return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO | MSE_MISC; #endif } @@ -454,31 +454,6 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags) { MouseDevPtr pMse = pInfo->private; - pMse->protocol = protocol; - xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol); - - /* Collect the options, and process the common options. */ - COLLECT_INPUT_OPTIONS(pInfo, NULL); - xf86ProcessCommonOptions(pInfo, pInfo->options); - - /* Check if the device can be opened. */ - pInfo->fd = xf86OpenSerial(pInfo->options); - if (pInfo->fd == -1) { - if (xf86GetAllowMouseOpenFail()) - xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name); - else { - xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name); - free(pMse); - pInfo->private = NULL; - return FALSE; - } - } - xf86CloseSerial(pInfo->fd); - pInfo->fd = -1; - - /* Process common mouse options (like Emulate3Buttons, etc). */ - pMse->CommonOptions(pInfo); - /* Setup the local input proc. */ pInfo->read_input = wsconsReadInput; pMse->xisbscale = sizeof(struct wscons_event); diff --git a/src/mouse.c b/src/mouse.c index d2377ad..0babc29 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -252,6 +252,7 @@ static MouseProtocolRec mouseProtocols[] = { /* Misc (usually OS-specific) */ { "SysMouse", MSE_MISC, mlDefaults, PROT_SYSMOUSE }, + { "WSMouse", MSE_MISC, NULL, PROT_WSMOUSE }, /* end of list */ { NULL, MSE_NONE, NULL, PROT_UNKNOWN } @@ -843,6 +844,9 @@ MousePickProtocol(InputInfoPtr pInfo, const char* device, *protocolID_out = protocolID; + if (protocolID == PROT_WSMOUSE && osInfo->PreInit) + osInfo->PreInit(pInfo, protocol, 0); + return protocol; } diff --git a/src/mouse.h b/src/mouse.h index 9f5b47e..6e63c54 100644 --- a/src/mouse.h +++ b/src/mouse.h @@ -77,6 +77,7 @@ typedef enum { PROT_BM, PROT_AUTO, PROT_SYSMOUSE, + PROT_WSMOUSE, PROT_NUMPROTOS /* This must always be last. */ } MouseProtocolID;