From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Schein Newsgroups: gmane.emacs.bugs Subject: bug#9186: patch for buggy drag behavior affecting emacs >=23 Date: Wed, 17 Aug 2011 09:13:16 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1313598266 26491 80.91.229.12 (17 Aug 2011 16:24:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2011 16:24:26 +0000 (UTC) To: 9186@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 17 18:24:14 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qtiuc-0008Q3-5a for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Aug 2011 18:24:14 +0200 Original-Received: from localhost ([::1]:59351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtiub-0007Gr-Bo for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Aug 2011 12:24:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtiuY-0007Gk-Fu for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 12:24:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtiuW-0002f3-PB for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 12:24:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtiuW-0002ew-NR for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 12:24:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QtiwM-00077i-HN; Wed, 17 Aug 2011 12:26:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andrew Schein Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Aug 2011 16:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9186 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9186-submit@debbugs.gnu.org id=B9186.131359832627310 (code B ref 9186); Wed, 17 Aug 2011 16:26:02 +0000 Original-Received: (at 9186) by debbugs.gnu.org; 17 Aug 2011 16:25:26 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qtivl-00076R-Dh for submit@debbugs.gnu.org; Wed, 17 Aug 2011 12:25:25 -0400 Original-Received: from mail-yx0-f172.google.com ([209.85.213.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qtilr-0006qE-9G for 9186@debbugs.gnu.org; Wed, 17 Aug 2011 12:15:12 -0400 Original-Received: by yxp4 with SMTP id 4so791482yxp.3 for <9186@debbugs.gnu.org>; Wed, 17 Aug 2011 09:13:16 -0700 (PDT) Original-Received: by 10.151.25.13 with SMTP id c13mr1457147ybj.208.1313597596570; Wed, 17 Aug 2011 09:13:16 -0700 (PDT) Original-Received: by 10.150.60.7 with HTTP; Wed, 17 Aug 2011 09:13:16 -0700 (PDT) X-Mailman-Approved-At: Wed, 17 Aug 2011 12:25:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 17 Aug 2011 12:26:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50107 Archived-At: Below is my fix to bug#9186.=A0 I located the area of the C code that deals with recording click events and noticed that there is logic that looks for extremely precise pixel placement rather than buffer position.=A0 In my opinion this leads to unexpected behavior; humans can no= t move their hands so precisely as they can reliably move their mouse to the area defined by fuzz.=A0 On the other hand, there are plenty of cues to indicate when the mouse is placed back into the original position. In proposing this fix I am a a little concerned about how the overall system will be effected.=A0 Why was this click_fuzz logic introduced to begin with? *** ./src/keyboard.c=A0=A0=A0 2011-08-15 16:25:02.516887000 -0700 --- ../copy2/trunk/src/keyboard.c=A0=A0=A0 2011-08-17 08:58:01.792927000 -0= 700 *************** *** 5630,5637 **** =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 event->modifiers |=3D click_modifier; =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 ignore_mouse_drag_p =3D 0; =A0 =A0=A0=A0 =A0=A0=A0 =A0 } ! =A0=A0=A0 =A0=A0=A0 else if (EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (pos= ition)))) ! =A0=A0=A0 =A0=A0=A0 =A0 /* Mouse has returned to its original position.= =A0 */ =A0 =A0=A0=A0 =A0=A0=A0 =A0 event->modifiers |=3D click_modifier; =A0 =A0=A0=A0 =A0=A0=A0 else =A0 =A0=A0=A0 =A0=A0=A0 =A0 { --- 5630,5649 ---- =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 event->modifiers |=3D click_modifier; =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 ignore_mouse_drag_p =3D 0; =A0 =A0=A0=A0 =A0=A0=A0 =A0 } ! =A0=A0=A0 =A0=A0=A0 else if (xdiff < double_click_fuzz && xdiff > - doubl= e_click_fuzz ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0&& ydiff < double_click_fuzz && ydiff > = - double_click_fuzz ! =A0=A0=A0 =A0=A0=A0 =A0 /* Maybe the mouse has moved a lot, caused scroll= ing, and ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0 eventually ended up at the same screen p= osition (but ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0 not buffer position) in which case it is= a drag, not ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0 a click.=A0 */ ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 /* FIXME: OTOH if the buffer position has c= hanged ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 because of a timer or process filt= er rather than ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 because of mouse movement, it shou= ld be considered as ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 a click.=A0 But mouse-drag-region = completely ignores ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 this case and it hasn't caused any= real problem, so ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 it's probably OK to ignore it as w= ell.=A0 */ ! =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 && EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr = (position)))) ! =A0=A0=A0 =A0=A0=A0 =A0 /* Mouse hasn't moved (much).=A0 */ =A0 =A0=A0=A0 =A0=A0=A0 =A0 event->modifiers |=3D click_modifier; =A0 =A0=A0=A0 =A0=A0=A0 else =A0 =A0=A0=A0 =A0=A0=A0 =A0 { -- Andrew I. Schein www.andrewschein.com