On Wed, Dec 16, 2015 at 11:14:28PM +0100, walter harms wrote: > > > Am 16.12.2015 01:15, schrieb Peter Hutterer: > > Make sure we discard any events that may have been enqueued before we > > re-opened the fd. Specifically, if we're using systemd-logind the fd remains > > open when we disable/enable the device, allowing events to queue up on the > > fd. These events are then replayed once the device is re-opened. > > > > This only applies to a device being disabled via the protocol, on VT switch > > logind closes the fd and we don't see enqueued events. > > > > Signed-off-by: Peter Hutterer <[email protected]> > > --- > > src/xf86libinput.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/src/xf86libinput.c b/src/xf86libinput.c > > index ee2165a..2fde9ed 100644 > > --- a/src/xf86libinput.c > > +++ b/src/xf86libinput.c > > @@ -1175,6 +1175,8 @@ open_restricted(const char *path, int flags, void > > *data) > > } > > > > fd = xf86OpenSerial(pInfo->options); > > + xf86FlushInput(fd); > > + > > return fd < 0 ? -errno : fd; > > } > > > > can xf86FlushInput() handle fd<0 ?
ah, good point, this will indeed mess up errno, patch coming up in a second. Cheers, Peter > perhaps it would be better to make clear that this is an error case like: > > fd = xf86OpenSerial(pInfo->options); > > if (fd<0) > return -errno ; > > xf86FlushInput(fd); > return fd; > > just my 2 cents, > re, > wh > > > > > > _______________________________________________ > [email protected]: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
