all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrew Schein <andrew@andrewschein.com>
To: 9186@debbugs.gnu.org
Subject: bug#9186: patch for buggy drag behavior affecting emacs >=23
Date: Wed, 17 Aug 2011 09:13:16 -0700	[thread overview]
Message-ID: <CAE49FEfR9Sqtms8Ww5XYVVhaQqRE9dGzspxD-PFMGSiB6ZeHqg@mail.gmail.com> (raw)
In-Reply-To: <CAE49FEcjNwzdpTBnqS27g8G_2Jcd1YCJ1+B=rFarYkfrqc6WBA@mail.gmail.com>

Below is my fix to bug#9186.  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.  In my opinion this leads to unexpected behavior; humans can not
move their hands so precisely as they can reliably move their mouse to
the area defined by fuzz.  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.  Why was this click_fuzz logic introduced to
begin with?


*** ./src/keyboard.c    2011-08-15 16:25:02.516887000 -0700
--- ../copy2/trunk/src/keyboard.c    2011-08-17 08:58:01.792927000 -0700
***************
*** 5630,5637 ****
              event->modifiers |= click_modifier;
              ignore_mouse_drag_p = 0;
            }
!         else if (EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (position))))
!           /* Mouse has returned to its original position.  */
            event->modifiers |= click_modifier;
          else
            {
--- 5630,5649 ----
              event->modifiers |= click_modifier;
              ignore_mouse_drag_p = 0;
            }
!         else if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz
!              && ydiff < double_click_fuzz && ydiff > - double_click_fuzz
!           /* Maybe the mouse has moved a lot, caused scrolling, and
!              eventually ended up at the same screen position (but
!              not buffer position) in which case it is a drag, not
!              a click.  */
!             /* FIXME: OTOH if the buffer position has changed
!                because of a timer or process filter rather than
!                because of mouse movement, it should be considered as
!                a click.  But mouse-drag-region completely ignores
!                this case and it hasn't caused any real problem, so
!                it's probably OK to ignore it as well.  */
!             && EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (position))))
!           /* Mouse hasn't moved (much).  */
            event->modifiers |= click_modifier;
          else
            {

--
Andrew I. Schein
www.andrewschein.com





  reply	other threads:[~2011-08-17 16:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28  4:56 bug#9186: drag copy buffer blown away by slight mouse movements on emacs 23.3.1 with GTK Andrew Schein
2011-08-17 16:13 ` Andrew Schein [this message]
2011-08-19 16:00   ` bug#9186: patch for buggy drag behavior affecting emacs >=23 Andrew Schein
2012-11-03 17:36 ` bug#9186: drag copy buffer blown away by slight mouse movements on emacs 23.3.1 with GTK Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE49FEfR9Sqtms8Ww5XYVVhaQqRE9dGzspxD-PFMGSiB6ZeHqg@mail.gmail.com \
    --to=andrew@andrewschein.com \
    --cc=9186@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.