mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-15 05:39:13 +00:00
Ignore WSMOUSEIO_GTYPE ioctl failure when checking /dev/wsmouse
When xf86-input-ws has attached separately to all existing mouse devices already or there are no mice plugged in, xf86-input-ws fails to attach to the wsmouse mux as a default fallback because there is no wsmouse device left in the mux to handle the WSMOUSEIO_GTYPE ioctl. If a USB mouse is later plugged in, there will not be any xf86-input-ws driver loaded listening to /dev/wsmouse for input. ok matthieu
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
/* $OpenBSD: ws.c,v 1.65 2020/09/13 10:26:31 matthieu Exp $ */
|
/* $OpenBSD: ws.c,v 1.66 2021/03/28 15:57:45 jcs Exp $ */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -67,6 +67,8 @@ static Atom prop_swap;
|
|||||||
int ws_debug_level = 0;
|
int ws_debug_level = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define WSMOUSE_MUX_DEVICE "/dev/wsmouse"
|
||||||
|
|
||||||
static XF86ModuleVersionInfo VersionRec = {
|
static XF86ModuleVersionInfo VersionRec = {
|
||||||
"ws",
|
"ws",
|
||||||
MODULEVENDORSTRING,
|
MODULEVENDORSTRING,
|
||||||
@@ -212,8 +214,17 @@ wsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
|
|||||||
}
|
}
|
||||||
if (wsOpen(pInfo) != Success)
|
if (wsOpen(pInfo) != Success)
|
||||||
goto fail;
|
goto fail;
|
||||||
if (ioctl(pInfo->fd, WSMOUSEIO_GTYPE, &priv->type) != 0)
|
if (ioctl(pInfo->fd, WSMOUSEIO_GTYPE, &priv->type) != 0) {
|
||||||
|
if (strcmp(priv->devName, WSMOUSE_MUX_DEVICE) == 0)
|
||||||
|
/*
|
||||||
|
* No mice are currently connected to the mux, assume
|
||||||
|
* any traffic we see on it later will come from a USB
|
||||||
|
* mouse.
|
||||||
|
*/
|
||||||
|
priv->type = WSMOUSE_TYPE_USB;
|
||||||
|
else
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
if (priv->type == WSMOUSE_TYPE_TPANEL) {
|
if (priv->type == WSMOUSE_TYPE_TPANEL) {
|
||||||
pInfo->type_name = XI_TOUCHSCREEN;
|
pInfo->type_name = XI_TOUCHSCREEN;
|
||||||
priv->raw = xf86SetBoolOption(pInfo->options, "Raw", 1);
|
priv->raw = xf86SetBoolOption(pInfo->options, "Raw", 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user