Skip to content

Commit 5e63bfc

Browse files
committed
if available, get the input device automatically
So for tslib >= 1.15 we don't require "Device" of "path" to be set Signed-off-by: Martin Kepplinger <martink@posteo.de>
1 parent 7c763b0 commit 5e63bfc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tslib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,16 @@ static int xf86TslibInit(__attribute__ ((unused)) InputDriverPtr drv,
475475
if (!priv->valuators)
476476
return BadValue;
477477

478-
/* FIXME get the path from libts */
478+
#ifdef TSLIB_VERSION_EVENTPATH
479+
pInfo->fd = open(ts_get_eventpath(priv->ts), O_RDONLY);
480+
#else
479481
if (!s) {
480482
xf86IDrvMsg(pInfo, X_ERROR, "Please provide Option path or Device");
481483
return BadValue;
482484
}
483485

484486
pInfo->fd = open(s, O_RDONLY);
487+
#endif
485488
if (pInfo->fd == -1) {
486489
xf86IDrvMsg(pInfo, X_ERROR, "Couldn't open %s\n", s);
487490
return BadValue;

0 commit comments

Comments
 (0)