From owner-svn-src-head@freebsd.org Thu May 4 23:02:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85609D5EB97; Thu, 4 May 2017 23:02:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8101AC9; Thu, 4 May 2017 23:02:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v44N2Yjf014016; Thu, 4 May 2017 23:02:34 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v44N2Y06014015; Thu, 4 May 2017 23:02:34 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201705042302.v44N2Y06014015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Thu, 4 May 2017 23:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317814 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 23:02:35 -0000 Author: wulf Date: Thu May 4 23:02:34 2017 New Revision: 317814 URL: https://svnweb.freebsd.org/changeset/base/317814 Log: psm(4): reduce cursor jumping on palm detection This is done with discarding pointer movements rather then mouse packets Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10266 Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu May 4 22:53:45 2017 (r317813) +++ head/sys/dev/atkbdc/psm.c Thu May 4 23:02:34 2017 (r317814) @@ -3017,13 +3017,15 @@ proc_synaptics(struct psm_softc *sc, pac ms->button = touchpad_buttons; + psmgestures(sc, &f[0], nfingers, ms); + for (id = 0; id < PSM_FINGERS; id++) + psmsmoother(sc, &f[id], id, ms, x, y); + /* Palm detection doesn't terminate the current action. */ - if (!psmpalmdetect(sc, &f[0], nfingers)) { - psmgestures(sc, &f[0], nfingers, ms); - for (id = 0; id < PSM_FINGERS; id++) - psmsmoother(sc, &f[id], id, ms, x, y); - } else { - VLOG(2, (LOG_DEBUG, "synaptics: palm detected! (%d)\n", f[0].w)); + if (psmpalmdetect(sc, &f[0], nfingers)) { + *x = *y = *z = 0; + ms->button = ms->obutton; + return (0); } ms->button |= extended_buttons | guest_buttons; @@ -3077,6 +3079,7 @@ psmpalmdetect(struct psm_softc *sc, fing * [min_pressure; max_pressure] * - pen aren't supported but PSM_FINGER_IS_PEN is set */ + VLOG(2, (LOG_DEBUG, "synaptics: palm detected! (%d)\n", f->w)); return (1); } return (0); @@ -4035,20 +4038,14 @@ proc_elantech(struct psm_softc *sc, pack ms->button = touchpad_button | trackpoint_button; - /* Palm detection doesn't terminate the current action. */ - if (!psmpalmdetect(sc, &f[0], nfingers)) { - /* Send finger 1 position to gesture processor */ - if (PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) || - nfingers == 0) - psmgestures(sc, &f[0], imin(nfingers, 3), ms); - /* Send fingers positions to movement smoothers */ - for (id = 0; id < PSM_FINGERS; id++) - if (PSM_FINGER_IS_SET(f[id]) || !(mask & (1 << id))) - psmsmoother(sc, &f[id], id, ms, x, y); - } else { - VLOG(2, (LOG_DEBUG, "elantech: palm detected! (%d)\n", - f[0].w)); - } + /* Send finger 1 position to gesture processor */ + if (PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) || + nfingers == 0) + psmgestures(sc, &f[0], imin(nfingers, 3), ms); + /* Send fingers positions to movement smoothers */ + for (id = 0; id < PSM_FINGERS; id++) + if (PSM_FINGER_IS_SET(f[id]) || !(mask & (1 << id))) + psmsmoother(sc, &f[id], id, ms, x, y); /* Store current finger positions in action context */ for (id = 0; id < ELANTECH_MAX_FINGERS; id++) { @@ -4059,6 +4056,13 @@ proc_elantech(struct psm_softc *sc, pack } sc->elanaction.mask = mask; + /* Palm detection doesn't terminate the current action. */ + if (psmpalmdetect(sc, &f[0], nfingers)) { + *x = *y = *z = 0; + ms->button = ms->obutton; + return (0); + } + /* Use the extra buttons as a scrollwheel */ if (ms->button & MOUSE_BUTTON4DOWN) *z = -1;