Date: Wed, 4 Jun 2014 21:09:38 +0000 (UTC) From: Jakub Wojciech Klama <jceel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r267080 - user/jceel/soc2014_evdev/head/sys/dev/usb/input Message-ID: <201406042109.s54L9cOR016844@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jceel Date: Wed Jun 4 21:09:38 2014 New Revision: 267080 URL: http://svnweb.freebsd.org/changeset/base/267080 Log: Disable sending 'empty' events (such as reporting relative move delta=0) to not confuse xf86-input-evdev module, thus making Xorg working with utouch(4). Modified: user/jceel/soc2014_evdev/head/sys/dev/usb/input/utouch.c Modified: user/jceel/soc2014_evdev/head/sys/dev/usb/input/utouch.c ============================================================================== --- user/jceel/soc2014_evdev/head/sys/dev/usb/input/utouch.c Wed Jun 4 20:05:52 2014 (r267079) +++ user/jceel/soc2014_evdev/head/sys/dev/usb/input/utouch.c Wed Jun 4 21:09:38 2014 (r267080) @@ -220,7 +220,7 @@ utouch_attach(device_t dev) evdev_support_abs(sc->sc_evdev, ABS_Y); if (sc->sc_flags & UTOUCH_FLAG_Z_AXIS) - evdev_support_rel(sc->sc_evdev, REL_Z); + evdev_support_rel(sc->sc_evdev, REL_WHEEL); for (i = 0; i < sc->sc_nbuttons; i++) evdev_support_key(sc->sc_evdev, BTN_MOUSE + i); @@ -296,10 +296,10 @@ utouch_intr_callback(struct usb_xfer *xf for (i = 0; i < sc->sc_nbuttons; i++) { if (hid_get_data(buf, len, &sc->sc_loc_btn[i])) buttons |= (1 << i); - - changed += buttons != 0; } + changed += buttons != sc->sc_oldbuttons; + if (changed) { utouch_report_event(sc, x, y, dz, buttons); sc->sc_oldx = x; @@ -353,22 +353,26 @@ utouch_report_event(struct utouch_softc { int i; - if (sc->sc_flags & UTOUCH_FLAG_X_AXIS) - evdev_push_event(sc->sc_evdev, EV_ABS, ABS_X, x); + if (x != sc->sc_oldx || y != sc->sc_oldy) { + if (sc->sc_flags & UTOUCH_FLAG_X_AXIS) + evdev_push_event(sc->sc_evdev, EV_ABS, ABS_X, x); - if (sc->sc_flags & UTOUCH_FLAG_Y_AXIS) - evdev_push_event(sc->sc_evdev, EV_ABS, ABS_Y, y); + if (sc->sc_flags & UTOUCH_FLAG_Y_AXIS) + evdev_push_event(sc->sc_evdev, EV_ABS, ABS_Y, y); + } - if (sc->sc_flags & UTOUCH_FLAG_Z_AXIS) - evdev_push_event(sc->sc_evdev, EV_REL, REL_Z, dz); + if (sc->sc_flags & UTOUCH_FLAG_Z_AXIS && dz != 0) + evdev_push_event(sc->sc_evdev, EV_REL, REL_WHEEL, dz); - for (i = 0; i < sc->sc_nbuttons; i++) { - if (((buttons & (1 << i)) ^ - (sc->sc_oldbuttons & (1 << i))) == 0) - continue; + if (buttons != sc->sc_oldbuttons) { + for (i = 0; i < sc->sc_nbuttons; i++) { + if (((buttons & (1 << i)) ^ + (sc->sc_oldbuttons & (1 << i))) == 0) + continue; - evdev_push_event(sc->sc_evdev, EV_KEY, - BTN_MOUSE + i, !!(buttons & (1 << i))); + evdev_push_event(sc->sc_evdev, EV_KEY, + BTN_MOUSE + i, !!(buttons & (1 << i))); + } } evdev_sync(sc->sc_evdev);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406042109.s54L9cOR016844>